[Haskell-cafe] handling rank 2 types

Simon Peyton-Jones simonpj at microsoft.com
Fri Nov 4 06:53:48 EST 2005


| But this gives a "less polymorphic" error.  I think the problem is
that
| ghc will not instantiate the "a'" in "IO a'" as a higher-rank type
| because it occurs within a type contructor.  I believe this is the
| restriction referred to at the end of 7.4.9[1].  If I instead write

I think that is indeed the heart of your problem.  Actually I'm writing
a paper right now about how to lift this restriction.  An out of date
version is here,
	http://research.microsoft.com/%7Esimonpj/papers/boxy/
that gives the general idea, but a much better version will be done in a
week's time.

It's not fully implemented yet, but I'll keep your message as an example
to try when it is.

Simon
-cafe


More information about the Haskell-Cafe mailing list