OLD (OBSOLETE) Version of a library with an implementation of tables as red-black trees:
A table is a finite mapping from keys to values.
All the operations on tables are generic, i.e., one has to provide
an explicit order predicate ("cmp" below) on elements.
Each inner node in the red-black tree contains a key-value association.
Author: Johannes Koj, Michael Hanus
Version: May 2001
| Exported names: |
Datatypes:
TableRBT
Functions:
emptyTableRBT
| lookupRBT
| tableRBT2list
| updateRBT
| Summary of exported functions: |
|
||
|
||
|
||
|
| Imported modules: |
| Exported datatypes: |
The structure of red-black trees.
Constructors:
| Exported functions: |
:: TableRBT a b
Returns an empty table, i.e., an empty red-black tree.
:: (a -> a -> Bool) -> a -> TableRBT a b -> Maybe b
Looks up an entry in a table.
Example call: (lookupRBT cmp k t)
cmp
- order predicate on keys
k
- a key under which a value is stored
t
- a table (represented as a red-black tree)
:: (a -> a -> Bool) -> a -> b -> TableRBT a b -> TableRBT a b
Inserts or updates an element in a table. The first argument is the order on elements.
:: TableRBT a b -> [(a,b)]
Transforms the nodes of red-black tree into a list.