4 Types
Primitive types.
The void identifier also works as an expression of type (-> void).
syntax
(type ... -> type)
Type for functions. Each type before the ->
corresponds to a function argument, and the type after
-> corresponds to a function result.
syntax
(type * ...+)
syntax
()
Type for the empty tuple.
syntax
(listof type)
Type for lists of elements, where type is the type of one element.
syntax
(boxof type)
Type for mutable boxes, where type is the type of the box’s content.
syntax
(vectorof type)
Type for vectors of elements, where type is the type of one element.
syntax
(parameterof type)
Type for parameters, where type is the type of the parameter’s value.
syntax
(hashof type type)
Type for hash tables, where the first type corresponds to
keys and the second type correspond to values.
syntax
(optionof type)
Defined as
(define-type (optionof 'a) [none] [some (v : 'a)])
and used, for example, for the result of hash-ref.