Please log in to watch this conference skillscast.
GHC's constraint solver is a notoriously difficult beast to understand, and there aren't many tools available to help us understand the process that GHC goes through while type-checking.
In this talk, we will give an overview of how GHC generates constraints in the process of type-checking, and how it goes about categorising them and solving them. In particular, we will cover:
- Wanted and Given constraints,
- GHC's classification of predicates,
- typeclass instance resolution,
- implication constraints and the recursive nature of constraint solving,
- how type-checking plugins fit in with this story.
YOU MAY ALSO LIKE:
- Haskell In Person: Bring Your Project, Get help with your code & socialise (in Berlin on 1st February 2023)
- An Introduction to Functional Reactive Programming and Yampa (in Zürich on 2nd February 2023)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
An Overview of GHC's Constraint Solver
Sam Derbyshire
In 2017, having completed my mathematics PhD in London (in the field of p-adic Hodge theory), I decided to go back to my roots in the French Pyrénées, to begin working on various Haskell projects, with a focus on graphics. I got to know Haskell's type system in the process, and decided to take things a step further this year: I begun working on GHC under the supervision of Richard Eisenberg, with a focus on type-checking plugins and representation polymorphism. Since then, I've started work at Well-Typed, and continue contributing to GHC.