Structures, signatures, functors

home1 home2
and the


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).

Although structure:signature is "like" value:type and a functor is "like" a function, it is only a matter of "like". Structures, signatures and functors belong very much to compile-time.

E.g. Traversable

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. For example, 't list and 't tree can be made Traversable.

[an error occurred while processing this directive]
Coding Ockham's Razor, L. Allison, Springer

A Practical Introduction to Denotational Semantics, L. Allison, CUP

free op. sys.
free office suite
~ free photoshop
web browser

:: cons
[x1,...] list
[ ] list
@ append
fn =>  &lambda .
: has type

structure, struct; signature, sig; functor

© L. Allison   (or as otherwise indicated),
Faculty of Information Technology (Clayton), Monash University, Australia 3800 (6/'05 was School of Computer Science and Software Engineering, Fac. Info. Tech., Monash University,
was Department of Computer Science, Fac. Comp. & Info. Tech., '89 was Department of Computer Science, Fac. Sci., '68-'71 was Department of Information Science, Fac. Sci.)
Created with "vi (Linux + Solaris)",  charset=iso-8859-1,  fetched Saturday, 25-May-2024 01:49:25 AEST.