[Haskell-cafe] Rank 2 polymorphism in pattern matching?

Bruno Oliveira bruno.oliveira at comlab.ox.ac.uk
Sat Apr 8 16:12:47 EDT 2006


See this message:


Your (initial) program should work in GHC 6.2. I actually find this feature useful, 
but Simon apparently changed this when moving to GHC 6.4 and nobody complained...
Apparently not many people use this feature.



On Sat, 08 Apr 2006 18:31:03 +0000, C Rodrigues wrote:

>This counterintuitive typechecking result came up when I wrote a wrapper 
>around runST.  Is there some limitation of HM with respect to type checking 
>pattern matching?

>data X a b = X (a -> a)
>run :: forall a. (forall b. X a b) -> a -> a
>-- This definition doesn't pass the typechecker
>run (X f) = f
>-- But this definition works
>run x = (\(X f) -> f) x

>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060408/e1867bab/attachment.htm

More information about the Haskell-Cafe mailing list