I was under the impression that, in ghc 6.4 at least, GADTs did just that: use information gained by matching on the type constructor to refine types. I sort-of expected that the extension to pattern matching would follow.

Or is that a nice paper waiting to be written?

Jacques

Lennart Augustsson <[EMAIL PROTECTED]> wrote:
A somewhat similar problem exists even without fields:

foo :: Either a b -> Either () b
foo (Left _) = Left ()
foo x@(Right _) = x

Since Haskell type checking doesn't use the information gained
by pattern matching to refine types we just have to accept that
some perfectly safe programs don't type check.

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

Reply via email to