c_wraith 2017-02-22 02:46:05
hc_: what's the type of withSapCarHandle?
hc_ 2017-02-22 02:46:47
c_wraith: withSapCarHandle :: (MonadIO m, MonadThrow m, MonadMask m) => (forall s. SapCar s m a) -> Handle -> m a
c_wraith 2017-02-22 02:47:17
hc_: In that case, it's a bug that it compiles in 8.0.1
hc_ 2017-02-22 02:47:29
:)
c_wraith 2017-02-22 02:48:08
hc_: it's the same issue runST has
hc_ 2017-02-22 02:48:53
Which of my type signatures is wrong?
c_wraith 2017-02-22 02:48:58
none, actually
c_wraith 2017-02-22 02:49:06
It's the implementation that's wrong.
hc_ 2017-02-22 02:49:14
-v please ;)
c_wraith 2017-02-22 02:49:21
I'm working on it. :)
hc_ 2017-02-22 02:49:28
okay, sorry for being so impatient
merijn 2017-02-22 02:49:34
hc_: Short summary: (.) doesn't like higher rank types
c_wraith 2017-02-22 02:49:50
The problem is that in your implementation, (.) needs to be instantiated at a polymorphic type
merijn 2017-02-22 02:49:52
hc_: $ has a hack built into the typechecker to make it work
c_wraith 2017-02-22 02:50:20
You can make it work by eta-expanding the definition
c_wraith 2017-02-22 02:50:29
(and not using (.))
hexagoxel 2017-02-22 02:50:37
@pointful withSapCarPath sarfile = bracket open close . withSapCarHandle
lambdabot 2017-02-22 02:50:37
withSapCarPath sarfile x = bracket open close (withSapCarHandle x);
hc_ 2017-02-22 02:50:57
Okay, that thought had occurred, but it didn't feel too nice ;)
hc_ 2017-02-22 02:51:02
I'll do that then, thank you
c_wraith 2017-02-22 02:51:19
There's nothing conceptually wrong with your code.
c_wraith 2017-02-22 02:51:31
But it would require a much more advanced type checker than GHC has.
c_wraith 2017-02-22 02:53:15
The name of the feature that would let it do what you're asking is impredicative polymorphism. GHC has made several tries at supporting it over time, and there is an extension that still claims to allow it, but it's basically completely non-functional. :)
c_wraith 2017-02-22 02:54:31
I believe that at this point, the official stance on that extension is that if it works for anything it's an accident and probably won't work in the next version of GHC. :)
hc_ 2017-02-22 02:55:40
Okay :)
merijn 2017-02-22 02:57:17
I have repeatedly asked for it to be deprecated, since SPJ has (also repeatedly) told me it doesn't work
merijn 2017-02-22 02:57:33
Well, the big problem with ImpredicativeTypes is not whether it works or not
merijn 2017-02-22 02:57:45
It's: No one knows what it's SUPPOSED to do in the first place
merijn 2017-02-22 02:58:07
It's unclear what the theory *should* be, so until that's sorted we don't even know what to implement :)
CoolerExtreme 2017-02-22 02:59:51
3drwsXA.,ljn
cocreature 2017-02-22 03:01:26
CoolerExtreme: you might want to change your password
Cooler 2017-02-22 03:03:05
cocreature, what?
cocreature 2017-02-22 03:03:39
Cooler: 14:59 3drwsXA.,ljn
Cooler 2017-02-22 03:04:08
cocreature, no thats just keyboard mash
Cooler 2017-02-22 03:04:28
i wish my passwords were that strong
ongy 2017-02-22 03:06:35
freenode supports client certs
max3 2017-02-22 03:06:45
what's the more idiomatic way to do this? isn't it Conf.getConfig >>= Conf.get "web.path" conf ?
max3 2017-02-22 03:06:47
http://lpaste.net
max3 2017-02-22 03:06:53
whoops
max3 2017-02-22 03:06:54
http://lpaste.net/352876
ongy 2017-02-22 03:06:54
does that show up if you whois me? I can see it when I /whois ongy
ongy 2017-02-22 03:07:40
Conf.get "web.path" <$> Conf.getConfig. But if that's more idiomatic, no idea
max3 2017-02-22 03:09:20
why isn't it >>=?
ongy 2017-02-22 03:09:38
what's the type of Conf.get ?
quchen 2017-02-22 03:09:58
ongy: Both are fine, pick whatever is more readable.
max3 2017-02-22 03:10:32
FilePath -> Conf.Config -> a
ongy 2017-02-22 03:10:44
:t (>>=)
lambdabot 2017-02-22 03:10:46
Monad m => m a -> (a -> m b) -> m b
ongy 2017-02-22 03:10:48
:t (<$>)
lambdabot 2017-02-22 03:10:50
Functor f => (a -> b) -> f a -> f b
ongy 2017-02-22 03:10:56
do you see, why it's the second one?
ph88^ 2017-02-22 03:11:13
did anyone know if this got a follow-up ? it looks pretty sweet to me https://www.youtube.com/watch?v=UsU8h0WYemo
max3 2017-02-22 03:12:01
oh because Conf.get doesn't return a monad
max3 2017-02-22 03:12:04
right?
ongy 2017-02-22 03:13:15
jup
max3 2017-02-22 03:13:39
thanks a lot
max3 2017-02-22 03:13:40
:)
Denommus 2017-02-22 03:26:33
I miss Haskell :-(