Easy GADTs by Repeating Yourself
summary
Argues that GADTs stay messy because language lacks patterns and tools and proposes a mechanical duplication: one ADT at the term level and a mirrored duplicate term/type representations plus tiny witness values to bridge them. Demonstrates real artifacts: code and a gist that implements type-level addition, simple proofs of properties, and a prototype plan for a Michelson interpreter; uses OCaml GADTs, first-class modules for contrast, and suggests witness values erased at runtime and PPX generation to automate the boilerplate. Demos compile and work but remain impractical for production.
AI-written summary · about
