FSharpPlus


NonEmptyMap Module

Basic operations on NonEmptyMap

Functions and values

Function or value Description

NonEmptyMap.add key value table

Full Usage: NonEmptyMap.add key value table

Parameters:
    key : 'a - The input key.
    value : 'b - The input value.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: NonEmptyMap<'a, 'b> The resulting map.

Returns a new map with the binding added to the given map. If a binding with the given key already exists in the input map, the existing binding is replaced by the new binding in the result map.

key : 'a

The input key.

value : 'b

The input value.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: NonEmptyMap<'a, 'b>

The resulting map.

NonEmptyMap.containsKey key table

Full Usage: NonEmptyMap.containsKey key table

Parameters:
    key : 'a - The input key.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: bool True if the map contains the key.

Tests if an element is in the domain of the map.

key : 'a

The input key.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: bool

True if the map contains the key.

NonEmptyMap.count table

Full Usage: NonEmptyMap.count table

Parameters:
Returns: int

The number of bindings in the map.

table : NonEmptyMap<'a, 'b>
Returns: int

NonEmptyMap.create (k, v) rest

Full Usage: NonEmptyMap.create (k, v) rest

Parameters:
    k : 'k
    v : 'v
    rest : ('k * 'v) seq

Returns: NonEmptyMap<'k, 'v>

Builds a non empty map.

k : 'k
v : 'v
rest : ('k * 'v) seq
Returns: NonEmptyMap<'k, 'v>

NonEmptyMap.exists predicate table

Full Usage: NonEmptyMap.exists predicate table

Parameters:
    predicate : 'a -> 'b -> bool - The function to test the input elements.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: bool True if the predicate returns true for one of the key/value pairs.

Returns true if the given predicate returns true for one of the bindings in the map.

predicate : 'a -> 'b -> bool

The function to test the input elements.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: bool

True if the predicate returns true for one of the key/value pairs.

NonEmptyMap.find key table

Full Usage: NonEmptyMap.find key table

Parameters:
    key : 'a - The input key.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: 'b The value mapped to the given key.

Lookup an element in the map, raising KeyNotFoundException if no binding exists in the map.

key : 'a

The input key.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: 'b

The value mapped to the given key.

KeyNotFoundException Thrown when the key does not exist in the map.

NonEmptyMap.findKey predicate table

Full Usage: NonEmptyMap.findKey predicate table

Parameters:
    predicate : 'a -> 'b -> bool - The function to test the input elements.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: 'a The first key for which the predicate evaluates true.

Evaluates the function on each mapping in the collection. Returns the key for the first mapping where the function returns 'true'. Raise KeyNotFoundException if no such element exists.

predicate : 'a -> 'b -> bool

The function to test the input elements.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: 'a

The first key for which the predicate evaluates true.

KeyNotFoundException Thrown if the key does not exist in the map.

NonEmptyMap.fold folder state table

Full Usage: NonEmptyMap.fold folder state table

Parameters:
    folder : 'a -> 'b -> 'c -> 'a - The function to update the state given the input key/value pairs.
    state : 'a - The initial state.
    table : NonEmptyMap<'b, 'c> - The input map.

Returns: 'a The final state value.

Folds over the bindings in the map

folder : 'a -> 'b -> 'c -> 'a

The function to update the state given the input key/value pairs.

state : 'a

The initial state.

table : NonEmptyMap<'b, 'c>

The input map.

Returns: 'a

The final state value.

NonEmptyMap.foldBack folder table state

Full Usage: NonEmptyMap.foldBack folder table state

Parameters:
    folder : 'a -> 'b -> 'c -> 'c - The function to update the state given the input key/value pairs.
    table : NonEmptyMap<'a, 'b> - The input map.
    state : 'c - The initial state.

Returns: 'c The final state value.

Folds over the bindings in the map.

folder : 'a -> 'b -> 'c -> 'c

The function to update the state given the input key/value pairs.

table : NonEmptyMap<'a, 'b>

The input map.

state : 'c

The initial state.

Returns: 'c

The final state value.

NonEmptyMap.forall predicate table

Full Usage: NonEmptyMap.forall predicate table

Parameters:
    predicate : 'a -> 'b -> bool - The function to test the input elements.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: bool True if the predicate evaluates to true for all of the bindings in the map.

Returns true if the given predicate returns true for all of the bindings in the map.

predicate : 'a -> 'b -> bool

The function to test the input elements.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: bool

True if the predicate evaluates to true for all of the bindings in the map.

NonEmptyMap.iter action table

Full Usage: NonEmptyMap.iter action table

Parameters:
    action : 'a -> 'b -> unit - The function to apply to each key/value pair.
    table : NonEmptyMap<'a, 'b> - The input map.

Applies the given function to each binding in the dictionary

action : 'a -> 'b -> unit

The function to apply to each key/value pair.

table : NonEmptyMap<'a, 'b>

The input map.

NonEmptyMap.iterValues f x

Full Usage: NonEmptyMap.iterValues f x

Parameters:
f : 'T -> unit
x : NonEmptyMap<'a, 'T>

NonEmptyMap.keys source

Full Usage: NonEmptyMap.keys source

Parameters:
Returns: 'Key seq
source : NonEmptyMap<'Key, 'T>
Returns: 'Key seq

NonEmptyMap.map mapping table

Full Usage: NonEmptyMap.map mapping table

Parameters:
    mapping : 'a -> 'b -> 'c - The function to transform the key/value pairs.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: NonEmptyMap<'a, 'c> The resulting map of keys and transformed values.

Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The key passed to the function indicates the key of element being transformed.

mapping : 'a -> 'b -> 'c

The function to transform the key/value pairs.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: NonEmptyMap<'a, 'c>

The resulting map of keys and transformed values.

NonEmptyMap.mapValues f x

Full Usage: NonEmptyMap.mapValues f x

Parameters:
    f : 'T -> 'a - The mapping function.
    x : NonEmptyMap<'Key, 'T> - The input Map.

Returns: NonEmptyMap<'Key, 'a> The mapped Map.

Map values of the original Map.

Keys remain unchanged.

f : 'T -> 'a

The mapping function.

x : NonEmptyMap<'Key, 'T>

The input Map.

Returns: NonEmptyMap<'Key, 'a>

The mapped Map.

NonEmptyMap.ofArray array

Full Usage: NonEmptyMap.ofArray array

Parameters:
    array : ('a * 'b) array - The input array.

Returns: NonEmptyMap<'a, 'b> Non empty map containing the elements of the array.

Builds a non empty map from the given array.

Throws exception for empty array

array : ('a * 'b) array

The input array.

Returns: NonEmptyMap<'a, 'b>

Non empty map containing the elements of the array.

ArgumentException Thrown when the input array is empty.

NonEmptyMap.ofList list

Full Usage: NonEmptyMap.ofList list

Parameters:
    list : ('a * 'b) list - The input list.

Returns: NonEmptyMap<'a, 'b> Non empty map containing the elements of the list.

Builds a non empty map from the given list.

Throws exception for empty list

list : ('a * 'b) list

The input list.

Returns: NonEmptyMap<'a, 'b>

Non empty map containing the elements of the list.

ArgumentException Thrown when the input list is empty.

NonEmptyMap.ofMap map

Full Usage: NonEmptyMap.ofMap map

Parameters:
    map : Map<'a, 'b> - The input map.

Returns: NonEmptyMap<'a, 'b> Non empty map containing the elements of the map.

Builds a non empty map from the given map.

Throws exception for empty map

map : Map<'a, 'b>

The input map.

Returns: NonEmptyMap<'a, 'b>

Non empty map containing the elements of the map.

ArgumentException Thrown when the input map is empty.

NonEmptyMap.ofNonEmptyList list

Full Usage: NonEmptyMap.ofNonEmptyList list

Parameters:
Returns: NonEmptyMap<'a, 'b> Non empty map containing the elements of the non-empty list.

Builds a non empty map from the given non-empty list.

list : NonEmptyList<'a * 'b>

The input list.

Returns: NonEmptyMap<'a, 'b>

Non empty map containing the elements of the non-empty list.

NonEmptyMap.ofNonEmptySeq source

Full Usage: NonEmptyMap.ofNonEmptySeq source

Parameters:
Returns: NonEmptyMap<'a, 'b> Non empty map containing the elements of the non-empty sequence.

Builds a non empty map from the given non-empty sequence.

source : NonEmptySeq<'a * 'b>

The input sequence.

Returns: NonEmptyMap<'a, 'b>

Non empty map containing the elements of the non-empty sequence.

NonEmptyMap.ofSeq seq

Full Usage: NonEmptyMap.ofSeq seq

Parameters:
    seq : ('a * 'b) seq - The input list.

Returns: NonEmptyMap<'a, 'b> Non empty map containing the elements of the list.

Builds a non empty map from the given sequence.

Throws exception for empty sequence

seq : ('a * 'b) seq

The input list.

Returns: NonEmptyMap<'a, 'b>

Non empty map containing the elements of the list.

ArgumentException Thrown when the input list is empty.

NonEmptyMap.pick chooser table

Full Usage: NonEmptyMap.pick chooser table

Parameters:
    chooser : 'a -> 'b -> 'c option - The function to generate options from the key/value pairs.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: 'c The first result.

Searches the map looking for the first element where the given function returns a Some value

chooser : 'a -> 'b -> 'c option

The function to generate options from the key/value pairs.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: 'c

The first result.

NonEmptyMap.reduce reduction map

Full Usage: NonEmptyMap.reduce reduction map

Parameters:
    reduction : 'a * 'b -> 'a * 'b -> 'a * 'b
    map : NonEmptyMap<'a, 'b>

Returns: 'a * 'b
reduction : 'a * 'b -> 'a * 'b -> 'a * 'b
map : NonEmptyMap<'a, 'b>
Returns: 'a * 'b

NonEmptyMap.reduceBack reduction map

Full Usage: NonEmptyMap.reduceBack reduction map

Parameters:
    reduction : 'a * 'b -> 'a * 'b -> 'a * 'b
    map : NonEmptyMap<'a, 'b>

Returns: 'a * 'b
reduction : 'a * 'b -> 'a * 'b -> 'a * 'b
map : NonEmptyMap<'a, 'b>
Returns: 'a * 'b

NonEmptyMap.singleton key value

Full Usage: NonEmptyMap.singleton key value

Parameters:
    key : 'a
    value : 'b

Returns: NonEmptyMap<'a, 'b>

Builds a non empty map with a single element.

key : 'a
value : 'b
Returns: NonEmptyMap<'a, 'b>

NonEmptyMap.toArray arg1

Full Usage: NonEmptyMap.toArray arg1

Parameters:
Returns: ('a * 'b)[]

Builds an array from the given non empty map.

arg0 : NonEmptyMap<'a, 'b>
Returns: ('a * 'b)[]

NonEmptyMap.toList arg1

Full Usage: NonEmptyMap.toList arg1

Parameters:
Returns: ('a * 'b) list

Builds a list from the given non empty map.

arg0 : NonEmptyMap<'a, 'b>
Returns: ('a * 'b) list

NonEmptyMap.toMap arg1

Full Usage: NonEmptyMap.toMap arg1

Parameters:
Returns: Map<'a, 'b>

Builds a map from the given non empty map.

arg0 : NonEmptyMap<'a, 'b>
Returns: Map<'a, 'b>

NonEmptyMap.toNonEmptyList arg1

Full Usage: NonEmptyMap.toNonEmptyList arg1

Parameters:
Returns: NonEmptyList<'a * 'b>

Builds a non-empty list from the given non empty map.

arg0 : NonEmptyMap<'a, 'b>
Returns: NonEmptyList<'a * 'b>

NonEmptyMap.toNonEmptySeq arg1

Full Usage: NonEmptyMap.toNonEmptySeq arg1

Parameters:
Returns: NonEmptySeq<'a * 'b>

Builds a non-empty sequence from the given non empty map.

arg0 : NonEmptyMap<'a, 'b>
Returns: NonEmptySeq<'a * 'b>

NonEmptyMap.toSeq arg1

Full Usage: NonEmptyMap.toSeq arg1

Parameters:
Returns: ('a * 'b) seq

Builds a sequence from the given non empty map.

arg0 : NonEmptyMap<'a, 'b>
Returns: ('a * 'b) seq

NonEmptyMap.traverse f m

Full Usage: NonEmptyMap.traverse f m

Parameters:
Returns: ^Functor>
Modifiers: inline
f : 'T -> ^Functor<'U>
m : NonEmptyMap<'K, 'T>
Returns: ^Functor>

NonEmptyMap.traversei f m

Full Usage: NonEmptyMap.traversei f m

Parameters:
Returns: ^Functor>
Modifiers: inline
f : 'K -> 'T -> ^Functor<'U>
m : NonEmptyMap<'K, 'T>
Returns: ^Functor>

NonEmptyMap.tryFind key table

Full Usage: NonEmptyMap.tryFind key table

Parameters:
    key : 'a - The input key.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: 'b option The found Some value or None.

Lookup an element in the map, returning a Some value if the element is in the domain of the map and None if not.

key : 'a

The input key.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: 'b option

The found Some value or None.

NonEmptyMap.tryFindKey predicate table

Full Usage: NonEmptyMap.tryFindKey predicate table

Parameters:
    predicate : 'a -> 'b -> bool - The function to test the input elements.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: 'a option The first key for which the predicate returns true or None if the predicate evaluates to false for each key/value pair.

Returns the key of the first mapping in the collection that satisfies the given predicate. Returns 'None' if no such element exists.

predicate : 'a -> 'b -> bool

The function to test the input elements.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: 'a option

The first key for which the predicate returns true or None if the predicate evaluates to false for each key/value pair.

NonEmptyMap.tryOfMap map

Full Usage: NonEmptyMap.tryOfMap map

Parameters:
    map : Map<'a, 'b>

Returns: NonEmptyMap<'a, 'b> option

Transforms a map to a NonEmptyMap, returning an option to signal when the original map was empty.

map : Map<'a, 'b>
Returns: NonEmptyMap<'a, 'b> option

NonEmptyMap.tryPick chooser table

Full Usage: NonEmptyMap.tryPick chooser table

Parameters:
    chooser : 'a -> 'b -> 'c option - The function to generate options from the key/value pairs.
    table : NonEmptyMap<'a, 'b> - The input map.

Returns: 'c option The first result.

Searches the map looking for the first element where the given function returns a Some value.

chooser : 'a -> 'b -> 'c option

The function to generate options from the key/value pairs.

table : NonEmptyMap<'a, 'b>

The input map.

Returns: 'c option

The first result.

NonEmptyMap.union source altSource

Full Usage: NonEmptyMap.union source altSource

Parameters:
Returns: NonEmptyMap<'Key, 'T>

Returns the union of two maps, preferring values from the first in case of duplicate keys.

source : NonEmptyMap<'Key, 'T>
altSource : NonEmptyMap<'Key, 'T>
Returns: NonEmptyMap<'Key, 'T>

NonEmptyMap.unionWith combiner source1 source2

Full Usage: NonEmptyMap.unionWith combiner source1 source2

Parameters:
    combiner : 'Value -> 'Value -> 'Value
    source1 : NonEmptyMap<'Key, 'Value>
    source2 : NonEmptyMap<'Key, 'Value>

Returns: NonEmptyMap<'Key, 'Value>

Returns the union of two maps, using the combiner function for duplicate keys.

combiner : 'Value -> 'Value -> 'Value
source1 : NonEmptyMap<'Key, 'Value>
source2 : NonEmptyMap<'Key, 'Value>
Returns: NonEmptyMap<'Key, 'Value>

NonEmptyMap.unzip source

Full Usage: NonEmptyMap.unzip source

Parameters:
Returns: NonEmptyMap<'Key, 'T1> * NonEmptyMap<'Key, 'T2>
source : NonEmptyMap<'Key, ('T1 * 'T2)>
Returns: NonEmptyMap<'Key, 'T1> * NonEmptyMap<'Key, 'T2>

NonEmptyMap.values source

Full Usage: NonEmptyMap.values source

Parameters:
Returns: 'T seq
source : NonEmptyMap<'Key, 'T>
Returns: 'T seq