Template meta-programming for Haskell
Proceedings of the 2002 ACM SIGPLAN workshop on Haskell
Simple unification-based type inference for GADTs
Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming
Foundations for structured programming with GADTs
Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Type checking with open type functions
Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
Comparing libraries for generic programming in haskell
Proceedings of the first ACM SIGPLAN symposium on Haskell
A lightweight approach to datatype-generic rewriting
Proceedings of the ACM SIGPLAN workshop on Generic programming
MPC '08 Proceedings of the 9th international conference on Mathematics of Program Construction
Generic programming with fixed points for mutually recursive datatypes
Proceedings of the 14th ACM SIGPLAN international conference on Functional programming
SSDGP'06 Proceedings of the 2006 international conference on Datatype-generic programming
SSDGP'06 Proceedings of the 2006 international conference on Datatype-generic programming
A generic deriving mechanism for Haskell
Proceedings of the third ACM Haskell symposium on Haskell
Proceedings of the 15th ACM SIGPLAN international conference on Functional programming
A lightweight approach to datatype-generic rewriting
Journal of Functional Programming
“Scrap your boilerplate” reloaded
FLOPS'06 Proceedings of the 8th international conference on Functional and Logic Programming
A pattern for almost homomorphic functions
Proceedings of the 8th ACM SIGPLAN workshop on Generic programming
Hi-index | 0.00 |
An indexed datatype is a type that uses a parameter as a type-level tag; a typical example is the type of vectors, which are indexed over a type-level natural number encoding their length. Since the introduction of generalised algebraic datatypes, indexed datatypes have become commonplace in Haskell. Values of indexed datatypes are often more involved than values of plain datatypes, and programmers would benefit from having generic programs on indexed datatypes. However, no generic programming library adequately supports them, leaving programmers with the tedious task of writing repetitive code. We show how to encode indexed datatypes in a generic programming library with type families and type-level representations in Haskell. Our approach can also be used in similar libraries, and is fully backwards-compatible. We show not only how to encode indexed datatypes generically, but also how to instantiate generic functions on indexed datatypes. Furthermore, all generic representations and instances are generated automatically, making life easier for users.