On 11 March 2011 11:15, Max Bolingbroke <[email protected]> wrote:
> On 10 March 2011 17:55, Bas van Dijk <[email protected]> wrote:
>> On 10 March 2011 18:24, Yves Parès <[email protected]> wrote:
>>> Why has the operator (.) troubles with a type like (forall s. ST s a)?
>>>
>>> Why can't it match the type 'b' in (.) definition?
>>
>> As explained by the email from SPJ that I linked to, instantiating a
>> type variable (like 'b') with a polymorphic type (like 'forall s. ST s
>> a' ) is called impredicative polymorphism. Since GHC-7 this is not
>> supported any more because it was to complicated.
>
> AFAIK this decision was reversed because SPJ found a simple way to
> support them. Indeed, they work fine in 7.0.2 and generate warnings.
> Try it out:

Great!

Unfortunately foo still doesn't type check in 7.0.2:

foo :: (forall s. ST s a) -> a
foo st = ($) runST st

For the same reason I still need this ugly hack in usb-safe:

http://hackage.haskell.org/packages/archive/usb-safe/0.12/doc/html/src/System-USB-Safe.html#withDeviceWhich

Bas

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to