Types
Construct a new Types instance with the specified parent. Use PrimitiveTypeDescriptor for the new type's descriptor.
Parameters
Entries
The most general type of the type lattice, also written ⊤ and pronounced "top". All types are subtypes of this, and all objects are instances of it. However, this top type has an additional role: No variable or argument may be of this type, so the only thing that can be done with the result of a function call of type ⊤ is to implicitly discard it. This is a precise way of making the traditional distinction between functions and procedures. In fact, Avail requires all statements except the last one in a block to be of type ⊤, to ensure that functions are not accidentally used as procedures – and to ensure that the reader of the code knows it.
This is the second-most general type in Avail's type lattice. It is the only direct descendant of top (⊤), and all types except ⊤ are subtypes of it. Like ⊤, all Avail objects are instances of ANY. Technically there is also a nil, but that is only used internally by the Avail machinery (e.g., the value of an unassigned variable) and can never be manipulated by an Avail program.
This is the kind of all characters, as defined by the Unicode standard. Note that all characters in the supplementary multilingual planes are explicitly supported.
Number is the generalization of all numeric types, which includes float, double, and the integer types (which can contain both integers and the signed integral infinities),
The type of all double-precision floating point numbers. This includes the double precision positive and negative infinities and Not-a-Number.
The type of all single-precision floating point numbers. This includes the single precision positive and negative infinities and Not-a-Number.
This is the kind of all message bundles, which are used during parsing of Avail code.
This is the kind of all definition parsing plans, which are used during parsing of Avail code.
The type of macro definitions.
This is the kind of all parsing-plans-in-progress, which are used during parsing of Avail code.
This is the kind of all message bundle trees, which are lazily expanded during parallel parsing of Avail expressions. They collapse together the cost of parsing method or macro invocations that start with the same tokens and arguments.
Tokens all have the same kind, except for literal tokens, which are parametrically typed by the type of value they contain. They are produced by a LexicalScanner and are consumed by the AvailCompiler.
The general kind of method signatures.
The specific kind of a definition which is an abstract declaration of a method.
The specific kind of definition which is a forward declaration. Such declarations must be resolved by the end of the module in which they occur.
The specific kind of definition which is an actual method function, by far the most common case.
Modules are maintained mostly automatically by Avail's runtime environment. Modules are not currently visible to the Avail programmer, but there may still be a need for modules to be placed in sets and maps maintained by the runtime, so the type story has to at least be consistent.
A POJO is a Plain Old Java Object. Avail is able to interface to arbitrary Java code via its implementation of POJOs. POJOs contain (and conform to) their own POJO types, but that requires a separate concept of raw POJOs. Avail code only works with the typed POJOs, but the Avail machinery has to be able to use the raw POJOs, placing them in sets and doing other things that occasionally require their kind to be extracted.