Please log in to watch this conference skillscast.
When GHC processes a Haskell program, it must perform type inference. This process includes both determining the types for definitions that lack type signatures and figuring out how polymorphic functions should be specialized at a particular usage site. To figure it all out, GHC looks at the Haskell program, generating constraints like "the type of x must match the expected argument type of f" and "the type of y must have a Show instance". Then, GHC must find a choice of types that satisfy all the constraints.
After a brief introduction to this generate-constraints-and-solve approach, this example-driven talk focuses on the constraint solver, explaining how it works, and showcases two large simplifications currently under way. You'll get a glimpse of how GHC works under the hood, learn why it's so hard to get good error messages, and get a sense for the kinds of problems that exist in GHC's type checker. This talk is also essential background information for anyone interested in writing type-checker plugins, though plugins will not be a focus of the talk. The audience should be able to understand simple Haskell programs; no advanced Haskell needed.
YOU MAY ALSO LIKE:
Simplifying Constraint Solving in GHC
Richard is a Principal Researcher at Tweag I/O. His research centers around how we can use static type systems to power high-assurance programming and avoid programmer mistakes, all without sacrificing ease-of-use or runtime efficiency. His language of focus is the pure functional language Haskell.
Richard is a core contributor to GHC and serves on the GHC Steering Committee. He lives in suburban Philadelphia with his wife and daughter.