2001
DOI: 10.1017/s0956796801004026
|View full text |Cite
|
Sign up to set email alerts
|

Red-black trees with types

Abstract: 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.

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

0
18
0

Year Published

2002
2002
2023
2023

Publication Types

Select...
5
2
2

Relationship

0
9

Authors

Journals

citations
Cited by 26 publications
(18 citation statements)
references
References 9 publications
0
18
0
Order By: Relevance
“…For example, one can use features of the specific encoding used to further constrain operations [ 13]. One can also capture programming invariants associated with user-defined datatypes [7]. An interesting direction for future work is formalizing these additional applications of the phantom types technique.…”
Section: Resultsmentioning
confidence: 99%
“…For example, one can use features of the specific encoding used to further constrain operations [ 13]. One can also capture programming invariants associated with user-defined datatypes [7]. An interesting direction for future work is formalizing these additional applications of the phantom types technique.…”
Section: Resultsmentioning
confidence: 99%
“…Red-Black trees have several non-trivial invariants that are ideal for illustrating the effectiveness of refinement types, and contrasting with existing approaches based on GADTs [19]. The structure can be defined via the following Haskell type: However, a Tree is a valid Red-Black tree only if it satisfies three crucial invariants:…”
Section: Red-black Treesmentioning
confidence: 99%
“…We may readily encode these 2-3 trees and give pattern synonyms for the three kinds of structure. This approach is much like that of red-black (effectively, 2-3-4) trees, for which typesafe balancing has a tradition going back to Hongwei Xi and Stefan Kahrs [9,19].…”
Section: Balanced 2-3 Treesmentioning
confidence: 99%