[Haskell-cafe] Inference for RankNTypes

Dan Doel dan.doel at gmail.com
Wed Jan 2 17:39:57 CET 2013

On Wed, Jan 2, 2013 at 11:20 AM, Dan Doel <dan.doel at gmail.com> wrote:

> Note that even left-to-right behavior covers all cases, as you might have:
>     f x y
> such that y requires x to be checked polymorphically in the same way.
> There are algorithms that can get this right in general, but it's a little
> tricky, and they're rather different than GHC's algorithm, so I don't know
> whether it's possible to make GHC behave correctly.

Oops, that should have been, "note that not even left-to-right behavior
covers all cases."

Also, I don't mean to imply that GHC is behaving wrongly. Situations like
these are usually the result of necessary trade-offs in the algorithms. GHC
does a lot of things that algorithms that successfully check this type of
examples don't have to deal with at all. You have to pick your poison.

-- Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130102/491a8c01/attachment.htm>

More information about the Haskell-Cafe mailing list