GHC's Renamer
summary
Overview of GHC’s renamer, its key datatypes and a live bugfix: the renamer resolves OccName/RdrName/Name and builds the GlobalRdrEnv, then must decide if a do-pattern is irrefutable via isIrrefutableHsPat. The demo traces a MonadFail error caused by pattern-synonym and complete-pragma handling, uses HLS to navigate the codebase, adds renamer-level complete-match tracking (tcg_complete_matches) and tweaks desugaring to emit a runtime pattern-failure instead of demanding MonadFail. The patch compiles and changes behavior but raises design choices and follow-up tests.
AI-written summary · about
chapters (26)
- 0:00GHC's renamer intro
- 1:12Renamer key tasks
- 3:01OccName and namespaces
- 5:13Unique identifiers in renamer
- 7:07RdrName role
- 9:18Variables in GHC
- 11:25Trees that Grow and Var
- 16:07TyThing info needs
- 19:27GlobalRdrEnv scoping
- 24:11Renamer and type checker
- 27:08Record update example
- 37:23Renamer processing
- 41:22Bug fixing intro
- 43:58MonadFail constraint issue
- 48:20Where MonadFail emitted
- 51:16Pattern data types limits
- 57:07Complete pragmas and synonyms
- 1:01:29Accumulating complete matches
- 1:08:23Updating isIrrefutableHsPat
- 1:11:24Testing fix and new issues
- 1:17:09Handling pattern failures
- 1:23:04Impact on user programs
- 1:27:22Renamer and do notation
- 1:31:00Future renamer improvements
- 1:34:09Disambiguating record updates
- 1:36:41Closing remarks
related talks
44mRevisiting pattern match overlap checks in Haskell
22mA look across the pond: a comparison between GHC and Racket compilation models
01h 30mGHC Proposal Presentations
04h 08mHaskell Beginners' Track
32mVerifying Haskell's Rewrite Rules based on Polymorphic Rewriting Theory
38mRefactoring Recursion
56mRhombus: The Non-shrubbery Parts (Keynote)
54mHaskell Project Showcase and Community Contributions
