A four-lecture tutorial on well-scoped de Bruijn indices for implementing type systems, interpreters, and program transformations.
Build the infrastructure from scratch: finite sets, binders, substitution environments, and a big-step evaluator for a simply-typed lambda calculus.
Use the rebound library to implement a language with (deep) pattern matching.
Generate well-scoped and well-typed lambda terms to enable property-based testing.
Implement continuation-passing-style conversion as a typed, scope-preserving term-to-term transformation, and test its correctness properties with QuickCheck.
This series of four 50-minute lectures covers how to represent and manipulate lambda-calculus terms using well-scoped de Bruijn indices in Haskell. The goal is to provide a practical basis for implementation, suitable for experimenting with language and logic design.
The target audience is students and researchers familiar with lambda calculi and functional programming (Haskell, OCaml, Rocq, or Agda). Some prior exposure to dependently-typed programming is helpful.