[Haskell-cafe] Solved but strange error in type inference
limestrael at gmail.com
Fri Jan 6 10:59:29 CET 2012
2012/1/6 AUGER Cédric <sedrikov at gmail.com>
> when you write "forall a. exists b. a -> b -> a", then you allow the
> caller to have access to b to produce a (didn't you write "a->b->a"?)
Yes, sorry, I always assumed independence between the type variables. Like
f :: forall a. a -> (forall b. b -> a)
being the same than:
f :: forall a b. a -> b -> a
I should have specified: "*if* a doesn't depend on b in the latter."
Of course the latter allows that, whereas the first does not (since its
what prevents STRefs from escaping runST, by forbidding the return type of
runST to depend on the phantom type 's' of the ST action).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe