Haskell to Core: Understanding Haskell Features Through Their Desugaring
summary
Explains how GHC desugars Haskell into System FC (Core), showing concrete translations: infix -> function application, multi-argument functions -> nested lambdas, patterns -> nested case expressions, do-notation -> sequences of bind calls that receive type and dictionary arguments, type parameters become lambda-bound values, and equality constraints become explicit coercions used by casts; Core itself is a tiny language (about nine Core constructs) that GHC produces after type checking, useful for debugging performance and correctness.
AI-written summary · about
chapters (17)
- 0:00Introduction to talk
- 1:59What is Core and sugaring
- 3:01GHC compiler pipeline
- 5:54Core language basics
- 9:03De-sugaring by example
- 11:54Pattern bindings and cases
- 13:41Multi-argument pattern matches
- 15:51If-then-else and seq
- 16:35Parametric polymorphism
- 18:01Type applications
- 18:44Existential quantification
- 20:32Type classes and dictionaries
- 22:37Do notation translation
- 24:26Coercions and casts
- 27:35GADTs and type equalities
- 29:42Type families explained
- 31:05Summary and resources
