Lists that keep track of their reversal
Summary
A technical blog post exploring OCaml type-system tricks to track list reversal, using nel-like non-empty lists and several approaches (GADTs, phantom types, and type-level constraints). It discusses benefits and trade-offs of enforcing invariants in the type system, and critiques practicality for real projects.