Deforestation: transforming programs to eliminate trees
Proceedings of the Second European Symposium on Programming
Programming in Martin-Lo¨f's type theory: an introduction
Programming in Martin-Lo¨f's type theory: an introduction
Cayenne—a language with dependent types
ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
Advanced Functional Programming, Second International School-Tutorial Text
Journal of Functional Programming
Faking it Simulating dependent types in Haskell
Journal of Functional Programming
TypeCase: a design pattern for type-indexed functions
Proceedings of the 2005 ACM SIGPLAN workshop on Haskell
ACM Transactions on Programming Languages and Systems (TOPLAS)
Lightweight Static Capabilities
Electronic Notes in Theoretical Computer Science (ENTCS)
Applicative programming with effects
Journal of Functional Programming
Proceedings of the 2008 ACM SIGPLAN workshop on ML
Journal of Functional Programming
The essence of the iterator pattern
Journal of Functional Programming
Arity-generic datatype-generic programming
Proceedings of the 4th ACM SIGPLAN workshop on Programming languages meets program verification
SSDGP'06 Proceedings of the 2006 international conference on Datatype-generic programming
Epigram: practical programming with dependent types
AFP'04 Proceedings of the 5th international conference on Advanced Functional Programming
Generic programming with dependent types
SSGIP'10 Proceedings of the 2010 international spring school conference on Generic and Indexed Programming
Closed type families with overlapping equations
Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
Hi-index | 0.00 |
This pearl is about some functions whose definitions seem to require a language with dependent types. We describe a technique for defining them in Haskell or ML, which are languages without dependent types.Consider, for example, the scheme defining zipWith in figure 1. When this scheme is instantiated with n equal to 1 we obtain the standard function map. In practice, other instances of the scheme are often useful as well.Figure 1 cannot be used as a definition of a function in Haskell because of the ellipses ‘...’. More importantly, the type of zipWith is parameterized by n, which seems to indicate the need for dependent types. However, as mentioned above, Haskell does not allow dependent types.