Re: interaction of GADTs and data families: a bug?

2010-04-15 Thread José Pedro Magalhães
Hi Sebastian, Is this perhaps another instance of #3851? http://hackage.haskell.org/trac/ghc/ticket/3851 Cheers, Pedro On Thu, Apr 15, 2010 at 14:10, Sebastian Fischer s...@informatik.uni-kiel.de wrote: Dear GHC experts, Certain behaviour when using {-# LANGUAGE GADTs, TypeFamilies

Re: interaction of GADTs and data families: a bug?

2010-04-15 Thread Sebastian Fischer
Is this perhaps another instance of #3851? http://hackage.haskell.org/trac/ghc/ticket/3851 Honestly: I don't know. My example is different from the one shown in #3851 in that it also does not work in GHC 6.10 (which even panics instead of giving the error 6.12 gives) and in that it uses a

Re: interaction of GADTs and data families: a bug?

2010-04-15 Thread José Pedro Magalhães
Hi Sebastian, On Thu, Apr 15, 2010 at 15:08, Sebastian Fischer s...@informatik.uni-kiel.de wrote: Is this perhaps another instance of #3851? http://hackage.haskell.org/trac/ghc/ticket/3851 Honestly: I don't know. My example is different from the one shown in #3851 in that it also does

Re: interaction of GADTs and data families: a bug?

2010-04-15 Thread Sebastian Fischer
but later in the comments I show an example with data families which fails on both 6.10.4 and 6.12.1. Ah, I think I misinterpreted your comment, when I read it for the first time. Thanks for pointing me at it again. But I still don't see whether or not the two examples are related. At

RE: interaction of GADTs and data families: a bug?

2010-04-15 Thread Sittampalam, Ganesh
Sebastian Fischer wrote: Dear GHC experts, Certain behaviour when using {-# LANGUAGE GADTs, TypeFamilies #-} surprises me. The following is accepted by GHC 6.12.1: data GADT a where BoolGADT :: GADT Bool foo :: GADT a - a - Int foo BoolGADT True = 42

Re: interaction of GADTs and data families: a bug?

2010-04-15 Thread Dan Doel
On Thursday 15 April 2010 8:10:42 am Sebastian Fischer wrote: Dear GHC experts, Certain behaviour when using {-# LANGUAGE GADTs, TypeFamilies #-} surprises me. The following is accepted by GHC 6.12.1: data GADT a where BoolGADT :: GADT Bool foo :: GADT a - a

Re: interaction of GADTs and data families: a bug?

2010-04-15 Thread Sebastian Fischer
With GADTs, the specific choice of constructor is what gives you the type matching functionality. My intention was to use a GADT as data family instance (hence, I wrote it in GADT style and it was accepted as such). Can't GADTs be used as data family instances? Sebastian --

RE: interaction of GADTs and data families: a bug?

2010-04-15 Thread Sittampalam, Ganesh
Sebastian Fischer wrote: With GADTs, the specific choice of constructor is what gives you the type matching functionality. My intention was to use a GADT as data family instance (hence, I wrote it in GADT style and it was accepted as such). Can't GADTs be used as data family instances?

Re: interaction of GADTs and data families: a bug?

2010-04-15 Thread Sebastian Fischer
On Apr 15, 2010, at 3:44 PM, Sittampalam, Ganesh wrote: You were trying to choose between different top-level types (which happen to be instances of the same family) by their constructors. That is true. I was trying to emulate an open data type such that I can write -- does not work

RE: interaction of GADTs and data families: a bug?

2010-04-15 Thread Simon Peyton-Jones
| My intention was to use a GADT as data family instance (hence, I | wrote it in GADT style and it was accepted as such). Can't GADTs be | used as data family instances? | | I'm not aware of any restriction there, but that's not the issue here. | | You were trying to choose between different