skip to main content
research-article

Closed type families with overlapping equations

Published:08 January 2014Publication History
Skip Abstract Section

Abstract

Open, type-level functions are a recent innovation in Haskell that move Haskell towards the expressiveness of dependent types, while retaining the look and feel of a practical programming language. This paper shows how to increase expressiveness still further, by adding closed type functions whose equations may overlap, and may have non-linear patterns over an open type universe. Although practically useful and simple to implement, these features go beyond conventional dependent type theory in some respects, and have a subtle metatheory.

Skip Supplemental Material Section

Supplemental Material

d3_left_t10.mp4

References

  1. M. Chakravarty, G. Keller, and S. Peyton Jones. Associated type synonyms. In ACM SIGPLAN International Conference on Functional Programming (ICFP'05), Tallinn, Estonia, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Coq development team. The Coq proof assistant reference manual. LogiCal Project, 2004. URL http://coq.inria.fr. Version 8.0.Google ScholarGoogle Scholar
  3. B. Courcelle. Fundamental properties of infinite trees. Theoretical computer science, 25 (2): 95--169, 1983.Google ScholarGoogle Scholar
  4. R. A. Eisenberg, D. Vytiniotis, S. Peyton Jones, and S. Weirich. Closed type families with overlapping equations (extended version). Technical report, University of Pennsylvania, 2013.Google ScholarGoogle Scholar
  5. D. Fridlender and M. Indrika. Functional pearl: Do we need dependent types? Journal of functional programming, 10 (4): 409--415, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. Garcia, J. Jarvi, A. Lumsdaine, J. G. Siek, and J. Willcock. A comparative study of language support for generic programming. In Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, OOPSLA '03, pages 115--134, New York, NY, USA, 2003. ACM. ISBN 1--58113--712--5. 10.1145/949305.949317. URL http://doi.acm.org/10.1145/949305.949317. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Huet. Résolution d'équations dans les langages d'ordre 1, 2,...ω. PhD thesis, Université de Paris VII, 1976.Google ScholarGoogle Scholar
  8. G. Huet. Confluent reductions: Abstract properties and applications to term rewriting systems. phJ. ACM, 27 (4): 797--821, Oct. 1980. ISSN 0004--5411. 10.1145/322217.322230. URL http://doi.acm.org/10.1145/322217.322230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Jaffar. Efficient unification over infinite terms. New Generation Computing, 2 (3): 207--219, 1984. ISSN 0288--3635. 10.1007/BF03037057. URL http://dx.doi.org/10.1007/BF03037057.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. P. Jones. Type classes with functional dependencies. In G. Smolka, editor, ESOP, volume 1782 of Lecture Notes in Computer Science, pages 230--244. Springer, 2000. ISBN 3--540--67262--1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. O. Kiselyov, R. Lämmel, and K. Schupke. Strongly typed heterogeneous collections. In Proc. 2004 ACM SIGPLAN Workshop on Haskell, Haskell '04, pages 96--107. ACM, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Klop. Term rewriting systems. In Handbook of logic in computer science (vol. 2), pages 1--116. Oxford University Press, Inc., 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. Knight. Unification: a multidisciplinary survey. ACM Comput. Surv., 21 (1): 93--124, Mar. 1989. ISSN 0360-0300. 10.1145/62029.62030. URL http://doi.acm.org/10.1145/62029.62030. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. McBride. Faking it: Simulating dependent types in Haskell. J. Funct. Program., 12 (5): 375--392, July 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. G. Morris and M. P. Jones. Instance chains: type class programming without overlapping instances. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming, ICFP '10, pages 375--386, New York, NY, USA, 2010. ACM. ISBN 978--1--60558--794--3. 10.1145/1863543.1863596. URL http://doi.acm.org/10.1145/1863543.1863596. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. H. A. Newman. On theories with a combinatorial definition of "equivalence". Annals of Mathematics, 43 (2): pp. 223--243, 1942. ISSN 0003486X. URL http://www.jstor.org/stable/1968867.Google ScholarGoogle ScholarCross RefCross Ref
  17. U. Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Department of Computer Science and Engineering, Chalmers University of Technology, SE-412 96 Göteborg, Sweden, September 2007.Google ScholarGoogle Scholar
  18. T. Schrijvers, S. Peyton Jones, M. Chakravarty, and M. Sulzmann. Type checking with open type functions. In Proceedings of the 13th ACM SIGPLAN international conference on Functional programming, ICFP '08, pages 51--62, New York, NY, USA, 2008. ACM. ISBN 978--1--59593--919--7. 10.1145/1411204.1411215. URL http://doi.acm.org/10.1145/1411204.1411215. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Sulzmann, M. M. T. Chakravarty, S. Peyton Jones, and K. Donnelly. System F with type equality coercions. In Proceedings of the 2007 ACM SIGPLAN international workshop on Types in languages design and implementation, TLDI '07, pages 53--66, New York, NY, USA, 2007a. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Sulzmann, G. Duck, S. Peyton Jones, and P. Stuckey. Understanding functional dependencies via constraint handling rules. phJournal of Functional Programming, 17: 83--130, Jan. 2007b. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. W. Swierstra. Data types à la carte. J. Funct. Program., 18 (4): 423--436, July 2008. ISSN 0956--7968. 10.1017/S0956796808006758. URL http://dx.doi.org/10.1017/S0956796808006758. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. Weirich and C. Casinghino. Arity-generic datatype-generic programming. In phProceedings of the 4th ACM SIGPLAN workshop on Programming languages meets program verification, PLPV '10, pages 15--26, New York, NY, USA, 2010. ACM. ISBN 978--1--60558--890--2. 10.1145/1707790.1707799. URL http://doi.acm.org/10.1145/1707790.1707799. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. Weirich, D. Vytiniotis, S. Peyton Jones, and S. Zdancewic. Generative type abstraction and type-level computation. In Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '11, pages 227--240, New York, NY, USA, 2011. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. Weirich, J. Hsu, and R. A. Eisenberg. Towards dependently typed Haskell: System FC with kind equality. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, ICFP '13, Boston, MA, USA, New York, NY, USA, 2013. ACM. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Yorgey, S. Weirich, J. Cretin, S. Peyton Jones, D. Vytiniotis, and J. P. Magalhães. Giving Haskell a promotion. In Proc. 8th ACM SIGPLAN workshop on Types in Language Design and Implementation, TLDI '12, pages 53--66. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Closed type families with overlapping equations

      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 49, Issue 1
        POPL '14
        January 2014
        661 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2578855
        Issue’s Table of Contents
        • cover image ACM Conferences
          POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
          January 2014
          702 pages
          ISBN:9781450325448
          DOI:10.1145/2535838

        Copyright © 2014 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 8 January 2014

        Check for updates

        Qualifiers

        • research-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!