A Hands on Tutorial to Generic Programming in Haskell (Part 2)
summary
Shows how to implement concrete generic operations: a working generic equality via GHC.Generics that compiles, the from/to pattern, and a default signature that derives Eq by converting values to their representation. Demonstrates the alternatives: a generics-sop code as type-level lists encoding constructors as lists of fields, using promoted datatypes and singletons to materialize runtime reps, and building per-field constraint bundles with Constraint Kinds traversal. Notes that GHC can optimize handcrafted generics but the examples actually compile and run.
AI-written summary · about
chapters (4)
related talks
01h 20mA Practical Introduction to Haskell GADTs
51mPragmatism, Puritanism and Functional Programming
52mCategory-parametric Programming
02h 28mIsomorphic Reasoning: Counting with Types Part 2
12mSingletons and You in Haskell
01h 52mIsomorphic Reasoning: Counting with Types Part 3
01h 39mIsomorphic Reasoning: Counting with Types Part 1
45mA practical introduction to Category Theory
