Extensible Haskell front-end for the Programatica project
What is in this directory (base/TI)
This directory contains a type checker for the base
language (i.e., more or less Haskell 98). It is structured to allow large
parts to be reusable in extended versions of the language.
At present,
the type inference monad is fixed, and the AST for inferred types is fixed,
but it might be possible to factor out these aspects too.
Although various details differ, this type checker is influenced by
- Mark Jones'
Typing Haskell in
Haskell (general guidance, some naming conventions, the class
Types
and operations on substitutions, ...),
- one of Johan Nordlander's type checkers for
O'Haskell
(that avoids both threading an accumulating substitution and
applying substitutions to the environment),
- and also somewhat by the type checker in
HBC.
(HBC serves as a proof that you don't need to resort to imperative
unification to implement efficient type inference, nor do you need
to sweep things under the carpet with a monad to make a purely
functional type checker readable.)
Modules for the basic type inference machinery
- TiMonad (NewTiMonad or OrigTiMonad),
TiClasses,
TiConstraints,
TiEnv,
TiFresh,
TiKinds,
TiSolve,
TiTypes,
TiUtil,
TI,
TiPretty,
TiNames,
Unification.
Instances and context reduction
-
TiBySuper,
TiContextReduction,
TiDefault,
TiDerivedInstances,
TiInstanceDB.
Type inference for the base language structure
These should be reusable in extended versions of the language.
- Declarations: TiD, TiClassInst, TiDkc,
- Expressions, patterns, etc: TiE, TiFields, TiLit,TiP, TiRhs,
- Kinds inference for type expressions: TiT,
- Modules: TiModule,
- Collects everything: TiBaseStruct.
Knot-tying definitions for the base language
- TiBase, TiDecorate, NameMapsDecorate
Type inference for sequences of declarations
Interfaces to other pieces of reusable code
- TiSCC, TiDefinedNames, TiFreeNames.
Other modules