ML 2007 START Conference Manager    

Generics for the Working ML'er

Vesa Karvonen

The 2007 ACM SIGPLAN Workshop on ML (ML 2007)
Freiburg, Germany, October 5, 2007


A popular and pragmatic approach to generic or type-indexed values in ML-like languages is to use a value-dependent encoding, where the type-indices 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 the encoding.

In this paper, we discuss an approach to type-indexed values based on the value-dependent encoding approach. We extend upon previous work in several ways. We present a technique that allows an existing value-dependent encoding to be extended with new values. We show how to encode type-indexed values over essentially all the ML types, including arbitrary mutually recursive datatypes. 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.

START Conference Manager (V2.54.4)