PFPL Chapter 15 Inductive and Coinductive Types
This part is not shown on PFPL preview version.
Some Forms of Recursive Type
Inductive and coinductive types are two important forms of recursive type.
On inductive type, elements are intuitively those given by finite composition of its introduction forms.
If we specify behavior of a function on each of introduction forms of an inductive type, then the behavior is defined for all values of the type.
Such a function is a recursor or catamorphism.
It is actually generalized fold.
Elements of a coinductive type are those behave properly in response to a finite composition of its elimination forms.
If we specify the behavior of an element on each elimination forms, then we have fully specified the value of that type.
Such an element is a generator or anamorphism.
It is actually generalized unfold.