Go to the Next or Previous section, the Detailed Contents, or the FS(E)L Home Page.


A.3.2 Named types

Nametype definitions associate a name with a type expression, meaning that `.' and `( , , )' operate on it as type constructors rather than value expressions. The type name may not take parameters.

For example,

nametype Values = {0..199}
nametype Ranges = Values . Values

has the same effect as

Values = {0..199}
Ranges = { x.y | x<-Values, y<-Values }

Note that outside of the `top-level' of a nametype (or datatype) definition, the expression `Values . Values' has the entirely different meaning of two copies of the set Values joined by the infix dot. Similarly the expression `(Values,Values)' means the cartesian product of Values for the construction of a name- or data-type, but a pair of two sets in all other contexts.


Go to the Next or Previous section, the Detailed Contents, or the FS(E)L Home Page.