data Nat = Zero | Succ Nat |
and
are constructors. In this case they are not polymorphic, but we can define
polymorphic constructors.
data Seq a = Empty | Cons a (Seq a) |
The constructors are and
, and are polymorphic.
Constructors are used to build terms, what distinguishes a constructor from a function is that there is no definition associated to a constructor, and constructors can be used in patterns.