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, Bernd Brassel
Version: March 2005
| Exported names: |
Datatypes:
TableRBT
Functions:
deleteRBT
| emptyTableRBT
| isEmptyTable
| lookupRBT
| tableRBT2list
| updateRBT
| Summary of exported functions: |
|
||
|
||
|
||
|
||
|
||
|
| Imported modules: |
| Exported datatypes: |
Type synonym: TableRBT a b = RedBlackTree (a,b)
| Exported functions: |
:: (a -> a -> Bool) -> RedBlackTree (a,b)
Returns an empty table, i.e., an empty red-black tree.
:: RedBlackTree (a,b) -> Bool
tests whether a given table is empty
:: a -> RedBlackTree (a,b) -> Maybe b
Looks up an entry in a table.
Example call: (lookupRBT k t)
k
- a key under which a value is stored
t
- a table (represented as a red-black tree)
:: a -> b -> RedBlackTree (a,b) -> RedBlackTree (a,b)
Inserts or updates an element in a table.
:: RedBlackTree (a,b) -> [(a,b)]
Transforms the nodes of red-black tree into a list.
:: a -> RedBlackTree (a,b) -> RedBlackTree (a,b)