fsprojects/FSharpx.Collections


PersistentHashMap

Namespace: FSharpx.Collections

Defines functions which allow to access and manipulate PersistentHashMaps.

Functions and values

Function or valueDescription
add key value map
Signature: key:'T -> value:'S -> map:PersistentHashMap<'T,'S> -> PersistentHashMap<'T,'S>
Type parameters: 'T, 'S

O(log32n), adds an element to the map

containsKey key map
Signature: key:'T -> map:PersistentHashMap<'T,'S> -> bool
Type parameters: 'T, 'S

O(log32n), returns if the key exists in the map

empty
Signature: PersistentHashMap<'T,'S>
Type parameters: 'T, 'S

O(1), returns an empty PersistentHashMap

find key map
Signature: key:'T -> map:PersistentHashMap<'T,'S> -> 'S
Type parameters: 'T, 'S

O(log32n), returns the value if the exists in the map

length map
Signature: map:PersistentHashMap<'T,'S> -> int
Type parameters: 'T, 'S

O(1), returns the count of the elements in the PersistentHashMap

map f map
Signature: f:('S -> 'S1) -> map:PersistentHashMap<'T,'S> -> PersistentHashMap<'T,'S1>
Type parameters: 'S, 'S1, 'T

O(n). Returns a HashMap whose elements are the results of applying the supplied function to each of the elements of a supplied HashMap.

ofSeq items
Signature: items:seq<'T * 'S> -> PersistentHashMap<'T,'S>
Type parameters: 'T, 'S

O(n). Returns a HashMap of the seq.

remove key map
Signature: key:'T -> map:PersistentHashMap<'T,'S> -> PersistentHashMap<'T,'S>
Type parameters: 'T, 'S

O(log32n), removes the element with the given key from the map

toSeq map
Signature: map:PersistentHashMap<'T,'S> -> seq<'T * 'S>
Type parameters: 'T, 'S

O(n). Views the given HashMap as a sequence.

Fork me on GitHub