This repo contains some experiments using a bidirectional typechecker. The approach is mostly based upon this tutorial, but adds some extra things:
- Step by step error reporting
- Support for typed holes
- Returns a typed expression, with type information at every node of the tree
The type-variables branch contains some additional code that allows users to specify types containing type variables (unification system based on the Purescript typechecker).
Right now the typechecker and examples are all located in a single file (src/Main.hs).
Execute the following commands to see the results:
$ git clone [email protected]:luc-tielen/typesystem.git
$ nix-shell # optional, if you prefer using Nix
$ cabal new-configure
$ cabal new-run typesystem
Output for the examples can also be found here.