Re: Simple GADTs Question

2005-10-06 Thread David Menendez
J. Garrett Morris writes:

> Hello,
> 
> I'm attempting to use GADTs for the first time, and I'm running into
> an (I think) odd error.  My file includes:
> 
> data DFExpr :: * -> *
> where Deriv :: (Num t) => t -> Deriv Int (DFExpr t) (DFExpr t)

I think you want something like this:

Deriv :: Int -> DFExpr t -> DFExpr t -> DFExpr t

Ignorning the other clauses, it's equivalent to

data DFExpr t = Deriv Int (DFExpr t) (DFExpr t)
-- 
David Menendez <[EMAIL PROTECTED]> | "In this house, we obey the laws
  |of thermodynamics!"
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Simple GADTs Question

2005-10-06 Thread J. Garrett Morris
Hello,

I'm attempting to use GADTs for the first time, and I'm running into
an (I think) odd error.  My file includes:

data DFExpr :: * -> *
where Deriv :: (Num t) => t -> Deriv Int (DFExpr t) (DFExpr t)
  (:+:) :: (Num t) => DFExpr t -> DFExpr t -> DFExpr t
-- and so forth,
  DFFeat :: FExpr t

and I'm getting an error "Not in scope: type constructor or class
`Deriv'.  I've got -fglasgow-exts in the options - what else should I
be doing?

 /g
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users