![]() | ![]() | ![]() | A recursive definition of a type | Documentation and user's manual | Table of contents | OCaml programs |
In Objective Caml, recursive definitions can be given not only to functions but also to types.
For instance evaluating this code
|
So, there exist recursive definitions of types and of functions as well.
Clearly, a type is a sets of values. Moreover a function can be considered as a set, too, that is, as the set of pairs (x,y) where y is the image of x under the function. Thus the notion of a recursive definition, usually called an inductive definition, of a set is basic. |
![]() | ![]() | ![]() | A recursive definition of a type | Documentation and user's manual | Table of contents | OCaml programs |