The type system for Laurel programs (each constructor is documented
individually below). Two constructors are internal, not surface types:
Unknown (resolution-error recovery / gradual wildcard) and MultiValuedExpr
(multi-output-call results).
Constructors
TVoid : Strata.Laurel.HighType
The void type, used for statements that produce no value.
TBool : Strata.Laurel.HighType
Boolean type.
TInt : Strata.Laurel.HighType
Arbitrary-precision integer type.
TFloat64 : Strata.Laurel.HighType
64-bit floating point type. Required for JavaScript (number), also used by Python (float) and Java (double).
TReal : Strata.Laurel.HighType
Mathematical real type. Maps to Core's real type.
TString : Strata.Laurel.HighType
String type for text data.
TSet (elementType : Strata.Laurel.AstNode Strata.Laurel.HighType) : Strata.Laurel.HighType
Set type, e.g. Set int.
TMap (keyType valueType : Strata.Laurel.AstNode Strata.Laurel.HighType) : Strata.Laurel.HighType
Map type.
UserDefined (name : Strata.Laurel.Identifier) : Strata.Laurel.HighType
A Identifier to a user-defined composite or constrained type by name.
TVar (name : Strata.Laurel.Identifier) : Strata.Laurel.HighType
A bound type variable, e.g. T in procedure f<T>(x: T). Introduced by
resolution when a name in type position matches an in-scope type parameter
(declared on a procedure, composite, or datatype). Distinct from UserDefined,
which names a concrete type.
Applied (base : Strata.Laurel.AstNode Strata.Laurel.HighType) (typeArguments : List (Strata.Laurel.AstNode Strata.Laurel.HighType)) : Strata.Laurel.HighType
A generic type application, e.g. List<Int>.
Intersection (types : List (Strata.Laurel.AstNode Strata.Laurel.HighType)) : Strata.Laurel.HighType
An intersection of types. Used for implicit intersection types, e.g. Scientist & Scandinavian.
TBv (size : Nat) : Strata.Laurel.HighType
Bitvector type of a given width.
Unknown : Strata.Laurel.HighType
Type used internally by the Laurel compilation pipeline. This type is used when a resolution error occurs, to continue compilation without producing superfluous errors Any type can be assigned to unknown and unknown can be assigned to any type. The unknown type can not be represented in Core so its occurence will abort compilation before evaluating Core
MultiValuedExpr (types : List (Strata.Laurel.AstNode Strata.Laurel.HighType)) : Strata.Laurel.HighType
An internal-only type produced by computeExprType for multi-output procedure calls.
Consumed by the resolution arity check and highEq. Should never appear in a serialized program.