On 4 July 2010 00:24, Yves Parès <limestr...@gmail.com> wrote:
> then it works, so obviously, the trouble is about pattern matching.
> What was I doing wrong?

This seems to be in violation of the Haskell Report. See e.g. section
3.3 (http://www.haskell.org/onlinereport/exps.html):

"""
The following identity holds:
\ p1 ... pn -> e        =       \ x1 ... xn -> case (x1, ..., xn) of (p1, ..., 
pn) -> e
where the xi are new identifiers.
"""

But:

runSomeMonad4, runSomeMonad5 :: (forall s. SomeMonad s a) -> a
runSomeMonad4 = \x -> case x of SomeMonad x -> runIdentity x
runSomeMonad5 = \(SomeMonad x) -> runIdentity x

runSomeMonad4 is accepted and runSomeMonad5 is rejected.

Of course, the Report doesn't make provision for rank-N types, so this
is not *strictly* speaking a violation. But it does seem against the
*spirit* of the report, if nothing else!

Cheers,
Max
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to