[silver:util:treemap]

Contents of [silver:util:treemap]:

Defined in this grammar:

One should always import this via ‘import silver:util:treemap as …’ The names are too general otherwise.


fun empty   (Ord a => Map<a b> ::= )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 13.

Returns a new, empty, multimap using Ord for comparison.


function emptyWith   (Map<a b> ::= comparator::(Integer ::= a a) )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 18.

Returns a new, empty, multimap using the specified comparator.


WARNING!
An ‘insert’ function is deliberating omitted due to its inefficiency, but there’s add:

function add   (Map<a b> ::= lst::[Pair<a b>] mp::Map<a b> )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 31.

Adds a list of elements to a map.


function keys   ([a] ::= mp::Map<a b> )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 42.

Returns a list of keys that are present in the map, in sorted order.


function lookup   ([b] ::= key::a mp::Map<a b> )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 53.

Looks up an element from the map, empty list if not contained.


fun fromList   (Ord a => Map<a b> ::= l::[Pair<a b>] )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 64.

Converts a list of pairs to a multimap.


function toList   ([Pair<a b>] ::= mp::Map<a b> )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 69.

Converts a multimap back to a list of pairs, in sorted order by key.


function update   (Map<a b> ::= key::a value::[b] mp::Map<a b> )

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 80.

Updates the value returned by a key

ffi type Map

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 8.

(Undocumented.)


instance Eq Map<a b>

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 88.

(Undocumented.)


instance Eq Map<a b>.eq

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 90.

(Undocumented.)


instance Ord Map<a b>

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 93.

(Undocumented.)


instance Ord Map<a b>.compare

Contained in grammar [silver:util:treemap]. Defined at silver/util/treemap/TreeMap.sv line 95.

(Undocumented.)