Skip to content
0:00 / 0:00

#ghc#typeinference#constraintsolving

Richard Eisenberg on Simplifying Constraint Solving in GHC

Berlin Functional Programming Group

2K subscribers • 8 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Richard Eisenberg
  • Linked in the descriptionarXiv 2011.04070

Advanced. Deep dive for people who know the field.

1.4K views5 years ago1 recommendation

Programming languagesSystems programmingHaskellCompilers and interpreters

Richard Eisenberg explains how GHC's constraint solver works for type inference and details ongoing efforts to simplify it.

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 will focus on the constraint solver, explaining how it works, and showcasing two large simplifications currently under way. Attendees will 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. 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. Richard's recent paper (mentioned in the talk): arxiv.org/abs/2011.04070 This virtual talk was brought to you by the Berlin Functional Programming Group. Join us on Meetup: meetup.com/Berlin-Functional-Programming-Group/ Follow us on Twitter: twitter.com/BerlinFPGroup Buy a T-shirt: teespring.com/berlin-fp-group Support us on Patreon: patreon.com/bfpg

Why it's here

1 person recommends this

What people say. Recommended as a deep dive into the internals of GHC's type checker and constraint solver.

u/ysangkokin r/haskell • Recommends

Richard Eisenberg on Simplifying Constraint Solving in GHC