Faking it Simulating dependent types in Haskell
Conor Thomas McBride · Journal of Functional Programming · 2002
Dependent types reflect the fact that validity of data is often a relative notion by allowing prior data to affect the types of subsequent data. Not only does this make for a precise type system, but also a highly generic one: both the type and the program for each instance of a family of operations can be computed from the data which codes for that instance. Recent experimental extensions to the Haskell type class mechanism give us strong tools to relativize types to other types . We may simulate some aspects of dependent typing by making counterfeit type-level copies of data, with type constructors simulating data constructors and type classes simulating datatypes. This paper gives examples of the technique and discusses its potential.
Cited by 109 works. doi:10.1017/s0956796802004355 Open-access PDF
Authors
References
- How to make ad-hoc polymorphism less ad hoc
- Cayenne—a language with dependent types
- PolyP---a polytypic programming language extension
- Computation and reasoning: a type theory for computer science
- Type Classes with Functional Dependencies
- Unification under a mixed prefix
- Dependently Typed Functional Programs and their Proofs
- Parametric overloading in polymorphic programming languages
- Type classes: an exploration of the design space
- Implementing type classes