Skip to content

Instantly share code, notes, and snippets.

@hirrolot
hirrolot / CoC.ml
Last active December 30, 2025 06:47
How to implement dependent types in 80 lines of code
type term =
| Lam of (term -> term)
| Pi of term * (term -> term)
| Appl of term * term
| Ann of term * term
| FreeVar of int
| Star
| Box
let unfurl lvl f = f (FreeVar lvl)