In coordination with the reserved syntax for type-annotation in block headers, the standard libraries include a collection of representations of primitive TYPES as well as quantifications over those types. The library of types is laid out within the non-delegated namespace Types in the lobby.
Types may be combined in various ways, including union:, intersection:, and extended via derive which preserve type constraints on the derivations.
Local slot specifiers in a Method header as well as input slot specifiers may have types optionally declared within the header. Within a method declaration expression, the input slots may be redundantly specified in the header as well as in the dispatch expression. However, if this is done, the header's specifier needs to be specified as an input slot and if multiple input slot types are specified, they should be specified in order.
The syntax is similar to that for @-based dispatch notation: follow the slot name with the bang character ``!'' and then a type expression, which may be a primitive or derived type. For example,
Type-inference on syntax trees is driven by calling inferTypes on the Syntax Node in question. This will process type information already annotated to produce derived annotations on related nodes.
Also, there is a facility to extend the type-inference capability per method. To explain, each Type object comes with a rules object slot that is dual to the traits delegate object; rules delegate as the traits do but do not confer to the types their methods. Instead, they are used by the inference system transparently to allow for more intelligent specialization. To wit:
Brian T. Rice 2005-06-08