Structures, signatures, functors

home1 home2
 Bib
 Algorithms
 Bioinfo
 FP
 Logic
 MML
 Prog.Lang
and the
 Book

FP
 SML
  SML97
   Structures

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

Linux
 Ubuntu
free op. sys.
OpenOffice
free office suite
The GIMP
~ free photoshop
Firefox
web browser

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

structure, struct; signature, sig; functor

© L. Allison   http://www.allisons.org/ll/   (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 Friday, 29-Mar-2024 05:47:51 AEDT.