On this page:
number
boolean
symbol
string
char
s-expression
void
->
listof
boxof
vectorof
parameterof
hashof
optionof

4 Types🔗ℹ

syntax

number

syntax

boolean

syntax

symbol

syntax

string

syntax

char

syntax

s-expression

syntax

void

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

Type for tuples. Each *-separated type is the type of an element in the tuple.

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.