playground/haskell/unsorted/mult-arg-datatype.hs

14 lines
352 B
Haskell

data Foo d a = Nil d a
| Cons a (Foo d a)
--data Vect n a = Cons a (Vect n a)
--data Vect (n::Int) a = Cons a (Vect n a)
--data Vect n a = Cons a (Vect n a)
-- | Nil a
--a = Nil 3
--Is it possible to have a type which accepts two arguments? I was trying to have something like ` data Vect (n::Int) a = Cons a (Vect n a)`