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.
Supplemental Material
- 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 Scholar
Digital Library
- Coq development team. The Coq proof assistant reference manual. LogiCal Project, 2004. URL http://coq.inria.fr. Version 8.0.Google Scholar
- B. Courcelle. Fundamental properties of infinite trees. Theoretical computer science, 25 (2): 95--169, 1983.Google Scholar
- 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 Scholar
- D. Fridlender and M. Indrika. Functional pearl: Do we need dependent types? Journal of functional programming, 10 (4): 409--415, 2000. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- G. Huet. Résolution d'équations dans les langages d'ordre 1, 2,...ω. PhD thesis, Université de Paris VII, 1976.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. Klop. Term rewriting systems. In Handbook of logic in computer science (vol. 2), pages 1--116. Oxford University Press, Inc., 1993. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- C. McBride. Faking it: Simulating dependent types in Haskell. J. Funct. Program., 12 (5): 375--392, July 2002. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Closed type families with overlapping equations
Recommendations
Closed type families with overlapping equations
POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesOpen, 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 ...
Constrained type families
We present an approach to support partiality in type-level computation without compromising expressiveness or type safety. Existing frameworks for type-level computation either require totality or implicitly assume it. For example, type families in ...
Injective type families for Haskell
Haskell '15Haskell, as implemented by the Glasgow Haskell Compiler (GHC), allows expressive type-level programming. The most popular type-level programming extension is TypeFamilies, which allows users to write functions on types. Yet, using type functions can ...







Comments