[Haskell-cafe] Bug in GADT Implementation?

2007-05-26 Thread Dominic Steinitz
I would expect foo r@(Range BITSTRING _ _) x = [] to give an error but it doesn't. Writing t = Range BITSTRING gives one so why not the pattern match? Dom. data BitString = BitString [Bool] deriving Show data ConstrainedType :: * - * where INTEGER :: ConstrainedType Int

Re: [Haskell-cafe] Bug in GADT Implementation?

2007-05-26 Thread Roberto Zunino
Dominic Steinitz wrote: I would expect foo r@(Range BITSTRING _ _) x = [] to give an error but it doesn't. Writing t = Range BITSTRING gives one so why not the pattern match? AFAICS, this is because when you construct a value, as in t, you have to provide the required context (Ord in

Re: [Haskell-cafe] Bug in GADT Implementation?

2007-05-26 Thread Dominic Steinitz
Roberto Zunino wrote: Dominic Steinitz wrote: I would expect foo r@(Range BITSTRING _ _) x = [] to give an error but it doesn't. Writing t = Range BITSTRING gives one so why not the pattern match? AFAICS, this is because when you construct a value, as in t, you have to provide the

Re: [Haskell-cafe] Bug in GADT Implementation?

2007-05-26 Thread David House
On 26/05/07, Dominic Steinitz [EMAIL PROTECTED] wrote: This seems even worse to me. A is not inhabited so how can 42 be of type A? I think it should work. The context on the F constructor says that A is an instance of Num, so you could only have an F value if you could prove that A was an

Re: [Haskell-cafe] Bug in GADT Implementation?

2007-05-26 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David House wrote: On 26/05/07, Dominic Steinitz [EMAIL PROTECTED] wrote: This seems even worse to me. A is not inhabited so how can 42 be of type A? I think it should work. The context on the F constructor says that A is an instance of Num, so