Abstract
Haskell's type system has outgrown its Hindley-Milner roots to the extent that it now stretches to the basics of dependently typed programming. In this paper, we collate and classify techniques for programming with dependent types in Haskell, and contribute some new ones. In particular, through extended examples---merge-sort and rectangular tilings---we show how to exploit Haskell's constraint solver as a theorem prover, delivering code which, as Agda programmers, we envy. We explore the compromises involved in simulating variations on the theme of the dependent function space in an attempt to help programmers put dependent types to work, and to inform the evolving language design both of Haskell and of dependently typed languages more broadly.
- A. Abel and G. Scherer. On irrelevance and algorithmic equality in predicative type theory. Logical Methods in Computer Science, 8 (1), 2012.Google Scholar
- W. Aitken and J. Reppy. Abstract value constructors. Technical Report TR 92--1290, Cornell University, 1992.Google Scholar
- B. Barras and B. Bernardo. The implicit calculus of constructions as a programming language with dependent types. In FoSSaCS, volume 4962 of LNCS, pages 365--379, 2008. Google Scholar
Digital Library
- E. Brady. Practical Implementation of a Dependently Typed Functional Programming Language. PhD thesis, University of Durham, 2005.Google Scholar
- E. Brady, C. McBride, and J. McKinna. Inductive families need not store their indices. In TYPES, volume 3085 of LNCS, pages 115--129. Springer, 2003.Google Scholar
- S. Cui, K. Donnelly, and H. Xi. ATS: A language that combines programming with theorem proving. In FroCoS, volume 3717 of LNCS, pages 310--320. Springer, 2005. Google Scholar
Digital Library
- R. A. Eisenberg and S. Weirich. Dependently typed programming with singletons. In Haskell, pages 117--130. ACM, 2012. Google Scholar
Digital Library
- G. P. Huet. The Zipper. J. Funct. Program., 7 (5): 549--554, 1997. Google Scholar
Digital Library
- O. Kiselyov and C.-c. Shan. Lightweight static resources: Sexy types for embedded and systems programming. In TFP, 2007.Google Scholar
- J. P. Magalhães. The right kind of generic programming. In WGP, pages 13--24. ACM, 2012. Google Scholar
Digital Library
- C. McBride. A Case For Dependent Families. Seminar at LFCS, Edinburgh. http://www.strictlypositive.org/a-case/, 2000.Google Scholar
- C. McBride. Kleisli arrows of outrageous fortune, 2011. Accepted for publication.\ https://personal.cis.strath.ac.uk/conor.mcbride/Kleisli.pdf.Google Scholar
- C. McBride. The Strathclyde Haskell Enhancement. https://personal.cis.strath.ac.uk/conor.mcbride/pub/she/, 2013.Google Scholar
- C. McBride and J. McKinna. The view from the left. J. Funct. Program., 14 (1): 69--111, 2004. Google Scholar
Digital Library
- C. McBride and R. Paterson. Applicative programming with effects. J. Funct. Program., 18 (1): 1--13, 2008. Google Scholar
Digital Library
- R. Milner. A theory of type polymorphism in programming. J. Comput. Syst. Sci., 17 (3): 348--375, 1978.Google Scholar
Cross Ref
- R. Milner, M. Tofte, and R. Harper. The Definition of standard ML. MIT Press, 1990. Google Scholar
Digital Library
- A. Miquel. The implicit calculus of constructions. In TLCA, LNCS, pages 344--359. Springer, 2001. Google Scholar
Digital Library
- S. Monnier and D. Haguenauer. Singleton types here, singleton types there, singleton types everywhere. In PLPV, pages 1--8. ACM, 2010. Google Scholar
Digital Library
- U. Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Department of Computer Science and Engineering, Chalmers University of Technology, September 2007.Google Scholar
- C. Paulin-Mohring. Extracting Fω's programs from proofs in the Calculus of Constructions. In POPL. ACM, 1989. Google Scholar
Digital Library
- R. Pollack. Implicit syntax. Informal Proceedings of First Workshop on Logical Frameworks, Antibes, 1990.Google Scholar
- J. C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, pages 55--74. IEEE Computer Society, 2002. Google Scholar
Digital Library
- M. Sulzmann, M. M. T. Chakravarty, S. L. P. Jones, and K. Donnelly. System F with type equality coercions. In TLDI, pages 53--66. ACM, 2007. Google Scholar
Digital Library
- P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad-hoc. In POPL, pages 60--76. ACM, 1989. Google Scholar
Digital Library
- S. Weirich, J. Hsu, and R. A. Eisenberg. Towards dependently typed Haskell: System FC with kind equality. In ICFP. ACM, 2013. Google Scholar
Digital Library
- B. A. Yorgey, S. Weirich, J. Cretin, S. L. Peyton Jones, D. Vytiniotis, and J. P. Magalhães. Giving Haskell a promotion. In TLDI, pages 53--66. ACM, 2012. Google Scholar
Digital Library
Index Terms
Hasochism: the pleasure and pain of dependently typed haskell programming
Recommendations
Hasochism: the pleasure and pain of dependently typed haskell programming
Haskell '13: Proceedings of the 2013 ACM SIGPLAN symposium on HaskellHaskell's type system has outgrown its Hindley-Milner roots to the extent that it now stretches to the basics of dependently typed programming. In this paper, we collate and classify techniques for programming with dependent types in Haskell, and ...
Dependently typed programming with singletons
Haskell '12Haskell programmers have been experimenting with dependent types for at least a decade, using clever encodings that push the limits of the Haskell type system. However, the cleverness of these encodings is also their main drawback. Although the ideas ...
Dependently typed programming with singletons
Haskell '12: Proceedings of the 2012 Haskell SymposiumHaskell programmers have been experimenting with dependent types for at least a decade, using clever encodings that push the limits of the Haskell type system. However, the cleverness of these encodings is also their main drawback. Although the ideas ...







Comments