Practical Datatype Specializations with Phantom Types and Recursion Schemes

  • Authors:
  • Matthew Fluet;Riccardo Pucella

  • Affiliations:
  • Department of Computer Science, Cornell University, Ithaca, NY 14853 USA;Department of Computer Science, Cornell University, Ithaca, NY 14853 USA

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Datatype specialization is a form of subtyping that captures program invariants on data structures that are expressed using the convenient and intuitive datatype notation. Of particular interest are structural invariants such as well-formedness. We investigate the use of phantom types for describing datatype specializations. We show that it is possible to express statically-checked specializations within the type system of Standard ML. We also show that this can be done in a way that does not lose useful programming facilities such as pattern matching in case expressions.