Expand description
Hindley-Milner type system with parametric polymorphism, type classes, and ADTs. The goal is to provide a reusable library for building typing environments for Rex. Features:
- Type variables, type constructors, function and tuple types.
- Schemes with quantified variables and class constraints.
- Type classes with superclass relationships and instance resolution.
- Basic ADTs (List, Result, Option) and numeric/string primitives in the prelude.
- Utilities to register additional function/type declarations (e.g.
(-),(/)).
Structs§
- AdtConflict
- AdtDecl
- A type declaration for an algebraic data type.
- AdtParam
- A named type parameter for an ADT (e.g.
ainList a). - AdtVariant
- A single ADT variant with zero or more constructor arguments.
- Class
- Class
Env - Class
Info - Semantic information about a type class declaration, derived from Rex source.
- Class
Method Info - Collect
Adts Error - Instance
- Predicate
- Prepared
Instance Decl - Scheme
- Type
- Type
Const - TypeEnv
- Type
System - Type
System Limits - TypeVar
- Type
VarSupply - Typed
Expr
Enums§
Traits§
Functions§
- collect_
adts_ in_ types - Collect all user-defined ADT constructors referenced by the provided types.
- compose_
subst - Compose substitutions
aafterb. - entails
- generalize
- Turn a monotype
typ(plus constraintspreds) into a polymorphicSchemeby quantifying over the type variables not free inenv. - instantiate
- prelude_
typeclasses_ program - unify
- Compute a most-general unifier for two types.