ABSTRACT
Generalized algebraic data types (GADTs), sometimes known as "guarded recursive data types" or "first-class phantom types", are a simple but powerful generalization of the data types of Haskell and ML. Recent works have given compelling examples of the utility of GADTs, although type inference is known to be difficult. Our contribution is to show how to exploit programmer-supplied type annotations to make the type inference task almost embarrassingly easy. Our main technical innovation is wobbly types, which express in a declarative way the uncertainty caused by the incremental nature of typical type-inference algorithms.
- Lennart Augustsson. Cayenne- a language with dependent types. In ACMSIGPLAN International Conference on Functional Programming (ICFP'98), volume 34(1) of ACM SIGPLAN Notices, pages 239--250, Baltimore, 1998. ACM. Google Scholar
Digital Library
- Lennart Augustsson and Kent Petersson. Silly type families. Available as http://www.cs.pdx.edu/~sheard/papers/silly. pdf, 1994.Google Scholar
- Arthur L Baars and S. Doaitse Swierstra. Typing dynamic typing. In ACMSIGPLAN International Conference on Functional Programming (ICFP'02), pages 157--166, Pittsburgh, September 2002. ACM. Google Scholar
Digital Library
- Luca Cardelli. Basic polymorphic typechecking. Polymorphism, 2(1), January 1985.Google Scholar
- James Cheney and Ralf Hinze. First-class phantom types. CUCIS TR2003-1901, Cornell University, 2003.Google Scholar
- Thierry Coquand. Pattern matching with dependent types. In Proceedings of the Workshop on Types for Proofs and Program, pages 66--79, Baastad, Sweden, June 1992.Google Scholar
- Peter Dybjer. Inductive Sets and Families in Martin-Lf's Type Theory. In Grard Huet and Gordon Plotkin, editors, Logical Frameworks. Cambridge University Press, 1991. Google Scholar
Digital Library
- Ralf Hinze. Fun with phantom types. In Jeremey Gibbons and Oege de Moor, editors, The fun of programming, pages 245--262. Palgrave, 2003.Google Scholar
- Barry Jay. The pattern calculus. ACM Transactions on Programming Languages and Systems, 26:911--937, November 2004. Google Scholar
Digital Library
- Lena Magnusson. The implementation of ALF - a proof editor based on Martin-Löf's monomorhic type theory with explicit substitution. PhD thesis, Chalmers University, 1994.Google Scholar
- Conor McBride and James McKinna. The view from the left. Journal of Functional Programming, 14(1):69--111, 2004. Google Scholar
Digital Library
- Erik Meijer and Koen Claessen. The design and implementation of Mondrian. In John Launchbury, editor, Haskell workshop, Amsterdam, Netherlands, 1997.Google Scholar
- Simon Peyton Jones. The Implementation of Functional Programming Languages. Prentice Hall, 1987. Google Scholar
Digital Library
- Simon Peyton Jones, Geoffrey Washburn, and Stephanie Weirich. Wobbly types: type inference for generalised algebraic data types. Microsoft Research, 2004.Google Scholar
- François Pottier and Yann Régis-Gianas. Stratified type inference for generalized algebraic data types. In ACM Symposium on Principles of Programming Languages (POPL'06), Charleston, January 2006. ACM. Google Scholar
Digital Library
- Tim Sheard. Languages of the future. In ACM Conference on Object Orientated Programming Systems, Languages and Applicatioons (OOPSLA'04), 2004. Google Scholar
Digital Library
- Tim Sheard. Putting Curry-Howard to work. In Proceedings of ACM Workshop on Haskell, Tallinn, pages 74--85, Tallinn, Estonia, September 2005. ACM. Google Scholar
Digital Library
- Tim Sheard and Emir Pasalic. Meta-programming with built-in type equality. In Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-languaegs (LFM'04), Cork, July 2004.Google Scholar
- Peter Stuckey and Martin Sulzmann. Type inference for guarded recursive data types. Technical report, National University of Singapore, 2005.Google Scholar
- Martin Sulzmann. A Haskell programmer's guide to Chameleon. Available at http://www.comp.nus.edu.sg/sulzmann/chameleon/download/haskell. html, 2003.Google Scholar
- Martin Sulzmann, JeremyWazny, and Peter Stuckey. A framework for extended algebraic data types. Technical report, National University of Singapore, 2005.Google Scholar
- Dimitrios Vytiniotis, Stephanie Weirich, and Simon Peyton Jones. Boxy type: Inference for higher-rank types and impredicativity. In ACMSIGPLAN International Conference on Functional Programming (ICFP'06), Portland, Oregon, 2006. ACM Press. Google Scholar
Digital Library
- Dimitrios Vytiniotis, Stephanie Weirich, and Simon Peyton Jones. Simple unification-based type inference for GADTs, Technical Appendix. Technical Report MS-CIS-05-22, University of Pennsylvania, April 2006.Google Scholar
- Hongwei Xi. Applied type system. In Proceedings of TYPES 2003, volume 3085 of Lecture Notes in Computer Science, pages 394--408. Springer Verlag, 2004.Google Scholar
Cross Ref
- Hongwei Xi, Chiyan Chen, and Gang Chen. Guarded recursive datatype constructors. In Proceedings of the 30th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, pages 224--235. ACM Press, 2003. Google Scholar
Digital Library
- Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In 26th ACM Symposium on Principles of Programming Languages (POPL'99), pages 214--227, San Antonio, January 1999. ACM. Google Scholar
Digital Library
- Christoph Zenger. Indexed types. Theoretical Computer Science, pages 147--165, 1997. Google Scholar
Digital Library
Index Terms
Simple unification-based type inference for GADTs
Recommendations
Simple unification-based type inference for GADTs
Proceedings of the 2006 ICFP conferenceGeneralized algebraic data types (GADTs), sometimes known as "guarded recursive data types" or "first-class phantom types", are a simple but powerful generalization of the data types of Haskell and ML. Recent works have given compelling examples of the ...
Type inference for GADTs, outsidein and anti-unification
SBLP '18: Proceedings of the XXII Brazilian Symposium on Programming LanguagesSupport for generalized algebraic data types (GADT) in extensions of Haskell allows functions defined over GADTs to be written without the need for type annotations in some cases, but it requires type annotations in most of them. This paper presents a ...
Gradual typing with unification-based inference
DLS '08: Proceedings of the 2008 symposium on Dynamic languagesStatic and dynamic type systems have well-known strengths and weaknesses. Gradual typing provides the benefits of both in a single language by giving the programmer control over which portions of the program are statically checked based on the presence ...







Comments