Another Composite Example
Computing with Lists
¥
An
IntList
is either:
Ð
Empty()
, the empty list, or
Ð
NonEmpty(first,rest)
, a non-empty list,
where
first
is an
int
and
rest
is an
IntList
.
¥
Some examples include:
Empty()
NonEmpty(7,Empty())
NonEmpty(12, NonEmpty(17, Empty()))
¥