Preface

Pie is the small dependently typed language of Friedman and Christiansen’s The Little Typer, implemented in about 6,700 lines of Racket, Typed Racket and Scribble. This tutorial teaches dependent type theory by reading that implementation alongside programs that have been run. It is written for a reader who knows Scheme and miniKanren but has not met dependent types.

  • Part I (Part I) uses Pie: types that mention values, the fixed menu of types, when Pie needs an annotation, and the eliminators with their motives.
  • Part II (Part II) proves things: definitional and propositional equality, induction, the constructor same and the eliminators cong, replace, symm, trans and ind-=, propositions as types, the empty and unit types, the universe, and proofs developed hole by hole with TODO.
  • Part III (Part III) opens the implementation: syntax, values and neutral terms, evaluation and read-back (normalization by evaluation), and the bidirectional checker that translates programs into a core language.

Every claim about the code cites file and line in the Pie repository, and every example is quoted with the output it actually produced. The last chapter (Chapter 10) compares Pie with Agda, Rocq, Lean and Idris, lists what Pie leaves out and the defects found while running the examples, gives a recipe for building a checker of this kind, and describes a port of Pie to CHICKEN Scheme that prints what Pie prints, except where it fixes the defect of cong.