[Haskell-cafe] Solved but strange error in type inference

Yves Parès 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
in:
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...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120106/3b110c3e/attachment.htm>


More information about the Haskell-Cafe mailing list