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

14 lines
352 B
Haskell
Raw Normal View History

2023-05-23 17:19:15 +00:00
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)`