- uses module-identifier, ..., module-identifier;
- all the definitions visible in the named modules are to be visible in
the current module or session.
The modules are searched for first in the current directory,
and then in a library directory.
Used modules may use other modules, and so on, provided there are no cycles.
Definitions visible in the using module (or session)
will not be visible in a used module,
unless the definitions reside in a third module used by both.
- private;
- all subsequent definitions in this module will be hidden from
other modules using it.
In particular, the visible definitions in a module used after this directive
will not be visible to any module using this one,
whereas they would be if the module was used before the directive.
- infix identifier, ..., identifier : numeric-literal;
- declare left associative infix operators
with the stated precedence,
from 1 (weakest) to 9 (strongest).
- infixr identifier, ..., identifier : numeric-literal;
- like infix, except that the operators
are right associative.
- abstype identifier [( identifier_ 1, ..., identifier_ n)];
- an `abstract' type definition,
declaring the identifier as a type or type constructor identifier,
which may be used in subsequent definitions.
The identifier may be defined later by a data or type definition.
If there is only one argument, the parentheses may be omitted.
- data identifier [( identifier_ 1, ..., identifier_ n)] ==
identifier_ 1' [ type_ 1] ++ ... ++
identifier_ k' [ type_ k];
- define the identifier as a type or type constructor,
with the identifier_ k' as its data constants and constructors.
If there is only one simple argument, the parentheses may be omitted.
The definition may be recursive.
Any uses of identifier in type_ i should have the same parameters as the
left-hand side.
Any constructor identifier may have been previously declared
in a dec declaration,
in which case the new type of the identifier must be an instance
of that given in the prior declaration.
- type identifier [( identifier_ 1, ..., identifier_ n)] == type;
- define the identifier as an abbreviation for the type,
which may refer to the argument type identifiers.
If there is only one simple argument, the parentheses may be omitted.
The definition may be recursive.
Any uses of identifier in type should have the same parameters as the
left-hand side.
See Regular types for more details.
- typevar identifier, ..., identifier;
- declare new type variables,
for use in dec declarations.
If identifier is declared, then identifier', identifier'' and so on
may also be used as type variables
(single quotes in identifier itself are ignored).
- dec identifier, ..., identifier : type;
- declare the identifiers as value identifiers of the given type,
in which type variables declared by typevar definitions
stand for any type.
If only one identifier is being declared, the keyword dec is optional.
- -- value-identifier pattern_ 1 ... pattern_ n <= expression;
- define the value of an identifier.
If n is zero, only one such definition is allowed for each identifier.
Otherwise, the identifier may be defined by one or more such definitions,
each with the same number of arguments.
See Semantics of pattern matching.
The keyword -- is optional.