Encoding types in ML-like languages
ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
QuickCheck: a lightweight tool for random testing of Haskell programs
ICFP '00 Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
A lightweight implementation of generics and dynamics
Proceedings of the 2002 ACM SIGPLAN workshop on Haskell
Scrap your boilerplate: a practical design pattern for generic programming
Proceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation
Embedding an interpreted language using higher-order functions and types
Proceedings of the 2003 workshop on Interpreters, virtual machines and emulators
Proceedings of the ninth ACM SIGPLAN international conference on Functional programming
FUNCTIONAL PEARL Pickler combinators
Journal of Functional Programming
Journal of Functional Programming
An expressive language of signatures
Proceedings of the tenth ACM SIGPLAN international conference on Functional programming
TypeCase: a design pattern for type-indexed functions
Proceedings of the 2005 ACM SIGPLAN workshop on Haskell
The standard ML basis library
Ocsigen: typing web interaction with objective Caml
Proceedings of the 2006 workshop on ML
Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Initializing Mutually Referential Abstract Objects: The Value Recursion Challenge
Electronic Notes in Theoretical Computer Science (ENTCS)
Comparing approaches to generic programming in Haskell
SSDGP'06 Proceedings of the 2006 international conference on Datatype-generic programming
Practical generic programming in OCaml
ML '07 Proceedings of the 2007 workshop on Workshop on ML
A generic programming toolkit for PADS/ML: first-class upgrades for third-party developers
PADL'08 Proceedings of the 10th international conference on Practical aspects of declarative languages
Libraries for generic programming in haskell
AFP'08 Proceedings of the 6th international conference on Advanced functional programming
Hi-index | 0.00 |
Generic values are type-indexed values defined over the structure of types. A popular and pragmatic approach to type-indexed values in ML-like languages is to use a value-dependent encoding,where the type representations carry the values being indexed. Unfortunately, the approach has a major drawback. Because the resulting encoding is specific to a particular set of values, extending an encoding with new values requires modifying it.In this paper, we discuss an approach to generics based on the value-dependent encoding approach. We extend upon previous work inseveral ways. We present a technique that allows an existing value-dependent encoding to be extended with new values. We show how toencode type representations over essentially all the ML-types. We also show how to compute fixed points over arbitrary products. Our techniques have been implemented in Standard ML, do not compromise abstraction, and require only a fixed number of combinators.