Note that the declaration of a structure, signature or functor
is not a declaration (dec).
It can only occur at the top-level of a program.
A structure, signature or functor is used in a specification (spec)
not in an expression or a normal declaration (dec)
(except to open a structure).
structure:signature is "like"
a functor is "like" a function,
it is only a matter of "like".
Structures, signatures and functors belong very much to compile-time.
Here is a simple example of Traversable data structures --
where the elements can be extracted in some systematic order.
For this example, a structured data type is Traversable if
it has functions (~methods)
initialise, next, advance and toList,
an elementType, and a state for a traverse.
't list and 't tree
can be made Traversable.
[an error occurred while processing this directive]
| :: || cons |
| [x1,...] || list |
| [ ] || list |
| @ || append |
| fn => || &lambda . |
| : || has type |
|structure, struct; signature, sig; functor