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.
- Joachim Breitner. 2018. Allow ScopedTypeVariables to refer to types. GHC proposal. https://github.com/ghc-proposals/ghc-proposals/pull/128Google Scholar
- Manuel M. T. Chakravarty, Gabriele Keller, Simon L. Peyton Jones, and Simon Marlow. 2005. Associated types with class. In POPL. ACM, 1–13. Google Scholar
Digital Library
- Richard A. Eisenberg, Dimitrios Vytiniotis, Simon L. Peyton Jones, and Stephanie Weirich. 2014. Closed type families with overlapping equations. In POPL. ACM, 671–684. Google Scholar
Digital Library
- Richard A. Eisenberg, Stephanie Weirich, and Hamidhasan G. Ahmed. 2016. Visible Type Application. In ESOP (LNCS), Vol. 9632. Springer, 229–254.Google Scholar
Digital Library
- J-Y Girard. 1990. The System F of variable types: fifteen years later. In Logical Foundations of Functional Programming, G Huet (Ed.). Addison-Wesley. Google Scholar
Digital Library
- Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. 1997. The Definition of Standard ML (Revised). MIT Press, Cambridge, Massachusetts. xii+114 pages. Google Scholar
Digital Library
- Simon L. Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Mark Shields. 2007. Practical type inference for arbitrary-rank types. Journal of Functional Programming 17, 1 (2007), 1–82. Google Scholar
Digital Library
- Simon L. Peyton Jones, Stephanie Weirich, Richard A. Eisenberg, and Dimitrios Vytiniotis. 2016. A Reflection on Types. In A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday (LNCS), Vol. 9600. Springer, 292–317.Google Scholar
- Matthew Pickering, Gergo Érdi, Simon L. Peyton Jones, and Richard A. Eisenberg. 2016. Pattern synonyms. In Haskell Symposium. ACM, 80–91. Google Scholar
Digital Library
- Tom Schrijvers, Simon L. Peyton Jones, Martin Sulzmann, and Dimitrios Vytiniotis. 2009. Complete and decidable type inference for GADTs. In ICFP. ACM, 341–352. Google Scholar
Digital Library
- Jan Stolarek, Simon L. Peyton Jones, and Richard A. Eisenberg. 2015. Injective type families for Haskell. In Haskell Symposium. ACM, 118–128. Google Scholar
Digital Library
- Emmanuel Suarez. 2017. Binding existential type variables. GHC proposal. https://github.com/ghc-proposals/ghc-proposals/pull/96Google Scholar
- Martin Sulzmann, Manuel M. T. Chakravarty, Simon L. Peyton Jones, and Kevin Donnelly. 2007. System F with type equality coercions. In TLDI. ACM, 53–66. Google Scholar
Digital Library
- Dimitrios Vytiniotis, Simon L. Peyton Jones, Tom Schrijvers, and Martin Sulzmann. 2011. OutsideIn(X) Modular type inference with local assumptions. Journal of Functional Programming 21, 4-5 (2011), 333–412. Google Scholar
Digital Library
Index Terms
Type variables in patterns
Recommendations
Type variables in patterns
Haskell 2018: Proceedings of the 11th ACM SIGPLAN International Symposium on HaskellFor 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 ...
Quantified types in an imperative language
We describe universal types, existential types, and type constructors in Cyclone, a strongly typed C-like language. We show how the language naturally supports first-class polymorphism and polymorphic recursion while requiring an acceptable amount of ...
Type inference, principal typings, and let-polymorphism for first-class mixin modules
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingA mixin module is a programming abstraction that simultaneously generalizes λ-abstractions, records, and mutually recursive definitions. Although various mixin module type systems have been developed, no one has investigated principal typings or ...







Comments