Skip to content

Latest commit

 

History

History
59 lines (49 loc) · 2.67 KB

README.md

File metadata and controls

59 lines (49 loc) · 2.67 KB

A small dependently typed language

This is an implementation of a small dependently typed language where types are first-class and where the return type of a function may depend on the arguments it is applied to.

Type checking is is implemented in terms of an elaborator, which checks and tanslates a user-friendly surface language into a simpler and more explicit core language that is more closely connected to type theory. Because we need to simplify types during elaboration we also implement an interpreter for the core language.

This was originally posted at tt-hoas-nameless.ml.

Example

let Bool : Type := fun (Out : Type) (true : Out) (false : Out) -> Out;
let true : Bool := fun Out true false => true;
let false : Bool := fun Out true false => false;

let not : Bool -> Bool := fun b =>
  fun Out true false => b Out false true;

true Bool false
$ cat ./test/readme/bools.txt | dependent norm
<input> :
  fun (false : fun (Out : Type) (true : Out) (false : Out) -> Out)
      (Out : Type) (true : Out) (false : Out) -> Out
:= fun false Out true false := false

Some useful resources