This repo contains an interpreter for a toy language based on simply-typed lambda calculus. It is designed to be a practical illustration of how Algorithm W works in OCaml code.
Most of the code (e.g. parser, type checker) is contained in /lib, with /lib/type_check.ml being the type inference/checking code, /lib/parser.mly containing parser definitions, etc.
This project uses Dune to build and run tests.
There are a couple of options to get Dune:
- If you already have Nix, you can run
nix developin the root directory of this repo. That will install Dune with required OPAM packages. - You can install Dune and the required OPAM packages manually, following the normal Dune documentation.
Run python3 -m http.serever --bind 127.0.0.1 in the root directory and open http://localhost:8000 in your browser.