[Haskell-cafe] GADT pattern match in non-rigid context
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Mon Sep 28 17:59:34 EDT 2009
On Sep 28, 2009, at 17:56 , João Paulo wrote:
> GADT pattern match in non-rigid context for `LeftCons'
> Solution: add a type signature
> In the pattern: LeftCons l' h_down [marked with #
> in the code]
>
> The suggestion is quite clear :D (in fact, I think this compiler
> suggestion is the result of previous interactions in this mailing
> list)
>
> The thing is that, in order to add a type signature to the suggested
> pattern, I believe I have to use the type variables in the signature
> of function 'move_down' (which I don't think is possible);
You want the ScopedTypeVariables extension. Read the documentation
before using; you need to explicitly forall the type variables you
want to use later.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090928/f79083e3/PGP.bin
More information about the Haskell-Cafe
mailing list