On Wed, Aug 22, 2007 at 11:57:39PM +0100, Simon Peyton-Jones wrote:
> The issue is different here. You are *lazily* matching the pattern, so it'd
> be unsound in general to accept this. Same thing if you said
> fstTy ~(a :-> b) = a
> Now in this case the RHS is strict in 'a' so it
alf Of *Conal Elliott
> *Sent:* 22 August 2007 23:34
> *To:* Simon Peyton-Jones
> *Cc:* cvs-ghc@haskell.org
> *Subject:* Re: ghc 6.7 and GADT pattern-matching
>
>
>
> How about this one (relative to same Ty def)?
>
> fstTy :: Ty (a -> b) -> Ty a
> fstTy
ng to do with rigidity. The error message is bad though
S
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Conal Elliott
Sent: 22 August 2007 23:34
To: Simon Peyton-Jones
Cc: cvs-ghc@haskell.org
Subject: Re: ghc 6.7 and GADT pattern-matching
How about this one (relative to same
How about this one (relative to same Ty def)?
fstTy :: Ty (a -> b) -> Ty a
fstTy (a :-> b) = a
fstTy' :: Ty (a -> b) -> Ty a
fstTy' ty = a where (a :-> b) = ty
The first definition works, while the second triggers the complaint about
non-rigidity.I don't know how to type-anno
The issue is this. When doing GADT matching, getting type inference to work
well, and interact well with other features (e.g. indexed type families) is
MUCH easier if the type being matched is totally known - we say "rigid". When
you used "$" you made GHC less sure about the type of the GADT m
No big deal after all. Replacing the ($) uses with regular parenthesized
application allows compilation to go through. - Conal
On 8/21/07, Conal Elliott <[EMAIL PROTECTED]> wrote:
>
> In going from ghc-6.6 to ghc-6.7, I've lost some GADT pattern matching
> that I'd really like to have back. The