scm $field
adds a field
to a scheme scm
.
Usually, all the fields are combined in a one expression, starting with the call to a function scheme
, e.g.,
scheme name $ age $ salary
The scheme
had type (('a -> 'r) -> 'r, ('a -> 'p) -> 'p) scheme
, then the type of a resulting scheme would be [(('a -> 'b -> 'r) -> 'r, ('a ->
'b -> 'p) -> 'p) scheme]
, i.e., a type of $field
will be attached to the scheme.
For example, the scheme name $age $salary
expression will have a type (assuming, that name, age and salary are represented with string, int, and int, correspondingly):
(string -> int64 -> int64 -> 'a) -> 'a,
(string -> int64 -> int64 -> 'b) -> 'b
The scheme is used to construct an attribute. See below.