Type variables in patterns
Richard A. Eisenberg, Joachim Breitner, Simon Peyton Jones

TL;DR
This paper provides a formal specification for binding type variables in patterns in Haskell, clarifying previous ambiguities and improving language design by extending existing features.
Contribution
It offers a formal specification for type variable binding in patterns, enabling more explicit and cleaner language semantics in Haskell.
Findings
Formal specification clarifies previous ambiguities
Extension of ScopedTypeVariables for explicit binding
Elimination of Proxy workaround
Abstract
For many years, GHC has implemented an extension to Haskell that allows type variables to be bound in type signatures and patterns, and to scope over terms. This extension was never properly specified. We rectify that oversight here. With the formal specification in hand, the otherwise-labyrinthine path toward a design for binding type variables in patterns becomes blindingly clear. We thus extend ScopedTypeVariables to bind type variables explicitly, obviating the Proxy workaround to the dustbin of history.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsScientific Computing and Data Management · Advanced Database Systems and Queries · Distributed and Parallel Computing Systems
