School of Computing

Red-black trees with types

Stefan Kahrs

Journal of Functional Programming, 11(4):182-196, July 2001.


Chris Okasaki showed how to implement red-black trees in a functional programming language. Ralf Hinze incorporated even the invariants of such data structures into their types, using higher-order nested datatypes. We show how one can achieve something very similar without the usual performance penalty of such types, by combining the features of nested datatypes, phantom types and existential type variables.

Bibtex Record

author = {Stefan Kahrs},
title = {Red-black trees with types},
month = {July},
year = {2001},
pages = {182-196},
keywords = {determinacy analysis, Craig interpolants},
note = {},
doi = {},
url = {},
    publication_type = {article},
    submission_id = {13813_1001084587},
    journal = {Journal of Functional Programming},
    volume = {11},
    number = {4},
    publisher = {Cambridge University Press},

School of Computing, University of Kent, Canterbury, Kent, CT2 7NF

Enquiries: +44 (0)1227 824180 or contact us.

Last Updated: 21/03/2014