~/talk

Secrets of the GHC Typechecker in 100 Type Declarations

Talkat 2023 GHC Contributors' Workshop · 2023-06-07..06-09· [haskell]
slides:none on file

Deep tour of GHC’s typechecker anchored in actual source: 50,000 lines of Haskell, modules like GHC.Tc.Gen (≈11k LOC), GHC.Tc.Solver (≈6k), GHC.Tc.Errors (≈9k), and concrete datatypes such as HsWrapper and HsExpansion. Shows the real pipeline: constraint generator → solver with zonking, meta-TcTyVars (IORef mutation), level numbers to prevent skolem escape, and how to trace with ddump-tc-trace/tc-trace. Works as presented — practical code pointers, debugging tips, and where to read and edit the Wiki. Watch if planning to modify or debug GHC’s typechecker.

AI-written summary · about

  1. 0:00GHC typechecker intro
  2. 1:12Talk overview and compiler pipeline
  3. 2:37Trees That Grow design
  4. 8:48Extension fields and payload
  5. 13:59Source vs desugaring typecheck
  6. 18:20Desugaring in renamer and TC
  7. 21:13Type inference and constraints
  8. 30:09Constraint solving process
  9. 39:52Modular GHC typechecker
  10. 42:21Zonking and unification
  11. 57:06Checking vs inference
  12. 1:04:57Typechecker traces in action
  13. 1:12:20Implication constraints and dicts
  14. 1:23:12Level numbers and skolems
  15. 1:34:09Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.