Some1 Like You Dependent Pairs in Haskell
summary
Builds a JSON ingest pipeline where a URL-supplied event tag determines the payload type at runtime and uses type‑level machinery so the compiler enforces correctness. It brings in exinst plus singletons and uses DataKinds TypeFamilies ConstraintKinds TemplateHaskell and Servant to lift value tags to types, produce FromJSON/ToJSON dictionaries as values, and represent payloads as a dependent pair. The result auto‑generates API shape and handlers, cuts boilerplate ~75%, and compiles and runs as intended.
AI-written summary · about
chapters (9)
- 0:00Introduction and motivation
- 2:08Building the naive solution
- 5:41Refining with prisms
- 11:39Data kinds and type families
- 15:43Existential types and GADTs
- 24:11Understanding singletons
- 31:09Implementing the logic
- 39:11Extending to JSON serialization
- 43:25Conclusion and dependent pairs








