Neil Mitchell | 17 Dec 17:21

GADT pattern match in non-rigid context

Hi,

Upgrading from GHC 6.6 to 6.8 has caused some code to stop working:

----------------------------------------------------------------------
{-# OPTIONS_GHC -fglasgow-exts #-}

module Data2 where

data CCompany

data Paradise :: * -> * where
    CC :: Paradise CCompany

rewrapCC CC = []
----------------------------------------------------------------------

[1 of 1] Compiling Data2            ( Data2.hs, interpreted )

Data2.hs:12:9:
    GADT pattern match in non-rigid context for `CC'
      Tell GHC HQ if you'd like this to unify the context
    In the pattern: CC
    In the definition of `rewrapCC': rewrapCC CC = []

This code is from the Uniplate benchmarking code, which runs the
Paradise benchmark from SYB on Uniplate, Compos and SYB. The Compos
code uses GADT's, so the program first needs to convert from standard
data structures to GADT's before it can work, then back at the end.
It's the problem of converting from a GADT to a normal data structure
(Continue reading)

Simon Peyton-Jones | 17 Dec 17:49

RE: GADT pattern match in non-rigid context

You should be giving a type signature to rewrap!  That should fix it.

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces <at> haskell.org
[mailto:glasgow-haskell-users-bounces <at> haskell.org] On Behalf Of
| Neil Mitchell
| Sent: 17 December 2007 16:23
| To: glasgow-haskell-users <at> haskell.org
| Subject: GADT pattern match in non-rigid context
|
| Hi,
|
| Upgrading from GHC 6.6 to 6.8 has caused some code to stop working:
|
| ----------------------------------------------------------------------
| {-# OPTIONS_GHC -fglasgow-exts #-}
|
| module Data2 where
|
| data CCompany
|
| data Paradise :: * -> * where
|     CC :: Paradise CCompany
|
| rewrapCC CC = []
| ----------------------------------------------------------------------
|
| [1 of 1] Compiling Data2            ( Data2.hs, interpreted )
(Continue reading)

Neil Mitchell | 17 Dec 18:03

Re: GADT pattern match in non-rigid context

Hi Simon,

> You should be giving a type signature to rewrap!  That should fix it.

Thanks, all works fine now :-)

Neil

>
> | -----Original Message-----
> | From: glasgow-haskell-users-bounces <at> haskell.org
[mailto:glasgow-haskell-users-bounces <at> haskell.org] On Behalf Of
> | Neil Mitchell
> | Sent: 17 December 2007 16:23
> | To: glasgow-haskell-users <at> haskell.org
> | Subject: GADT pattern match in non-rigid context
> |
> | Hi,
> |
> | Upgrading from GHC 6.6 to 6.8 has caused some code to stop working:
> |
> | ----------------------------------------------------------------------
> | {-# OPTIONS_GHC -fglasgow-exts #-}
> |
> | module Data2 where
> |
> | data CCompany
> |
> | data Paradise :: * -> * where
> |     CC :: Paradise CCompany
(Continue reading)

Isaac Dupree | 23 Dec 22:49

Re: GADT pattern match in non-rigid context

Neil Mitchell wrote:
> Hi Simon,
> 
>> You should be giving a type signature to rewrap!  That should fix it.
> 
> Thanks, all works fine now :-)

it would be great if the error message suggested giving a type signature 
as a solution (or maybe it already does, in the HEAD?)

Isaac

> 
> Neil
> 
>> | -----Original Message-----
>> | From: glasgow-haskell-users-bounces <at> haskell.org
[mailto:glasgow-haskell-users-bounces <at> haskell.org] On Behalf Of
>> | Neil Mitchell
>> | Sent: 17 December 2007 16:23
>> | To: glasgow-haskell-users <at> haskell.org
>> | Subject: GADT pattern match in non-rigid context
>> |
>> | Hi,
>> |
>> | Upgrading from GHC 6.6 to 6.8 has caused some code to stop working:
>> |
>> | ----------------------------------------------------------------------
>> | {-# OPTIONS_GHC -fglasgow-exts #-}
>> |
(Continue reading)

Simon Peyton-Jones | 24 Dec 10:57

RE: GADT pattern match in non-rigid context

| >> You should be giving a type signature to rewrap!  That should fix it.
| >
| > Thanks, all works fine now :-)
|
| it would be great if the error message suggested giving a type signature
| as a solution (or maybe it already does, in the HEAD?)

Good point: I'll do that.

Simon

| >> | -----Original Message-----
| >> | From: glasgow-haskell-users-bounces <at> haskell.org [mailto:glasgow-haskell-
| users-bounces <at> haskell.org] On Behalf Of
| >> | Neil Mitchell
| >> | Sent: 17 December 2007 16:23
| >> | To: glasgow-haskell-users <at> haskell.org
| >> | Subject: GADT pattern match in non-rigid context
| >> |
| >> | Hi,
| >> |
| >> | Upgrading from GHC 6.6 to 6.8 has caused some code to stop working:
| >> |
| >> | ----------------------------------------------------------------------
| >> | {-# OPTIONS_GHC -fglasgow-exts #-}
| >> |
| >> | module Data2 where
| >> |
| >> | data CCompany
| >> |
(Continue reading)


Gmane