skip to main content
article
Public Access

Type variables in patterns

Published:17 September 2018Publication History
Skip Abstract Section

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.

References

  1. Joachim Breitner. 2018. Allow ScopedTypeVariables to refer to types. GHC proposal. https://github.com/ghc-proposals/ghc-proposals/pull/128Google ScholarGoogle Scholar
  2. Manuel M. T. Chakravarty, Gabriele Keller, Simon L. Peyton Jones, and Simon Marlow. 2005. Associated types with class. In POPL. ACM, 1–13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. Richard A. Eisenberg, Stephanie Weirich, and Hamidhasan G. Ahmed. 2016. Visible Type Application. In ESOP (LNCS), Vol. 9632. Springer, 229–254.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. 1997. The Definition of Standard ML (Revised). MIT Press, Cambridge, Massachusetts. xii+114 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle Scholar
  9. Matthew Pickering, Gergo Érdi, Simon L. Peyton Jones, and Richard A. Eisenberg. 2016. Pattern synonyms. In Haskell Symposium. ACM, 80–91. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. Jan Stolarek, Simon L. Peyton Jones, and Richard A. Eisenberg. 2015. Injective type families for Haskell. In Haskell Symposium. ACM, 118–128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Emmanuel Suarez. 2017. Binding existential type variables. GHC proposal. https://github.com/ghc-proposals/ghc-proposals/pull/96Google ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Type variables in patterns

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 53, Issue 7
          Haskell '18
          July 2018
          185 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/3299711
          Issue’s Table of Contents
          • cover image ACM Conferences
            Haskell 2018: Proceedings of the 11th ACM SIGPLAN International Symposium on Haskell
            September 2018
            185 pages
            ISBN:9781450358354
            DOI:10.1145/3242744

          Copyright © 2018 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 17 September 2018

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!