Header menu logo FSharp.Data.Adaptive

AMap Module

Functional operators for amap<_,_>

Functions and values

Function or value Description

averageBy mapping map

Full Usage: averageBy mapping map

Parameters:
    mapping : 'K -> 'V -> ^T
    map : amap<'K, 'V>

Returns: aval<^S>
Modifiers: inline
Type parameters: 'K, 'V, ^T, ^S

Adaptively computes the average of all values returned by mapping for the map.

mapping : 'K -> 'V -> ^T
map : amap<'K, 'V>
Returns: aval<^S>

averageByA mapping map

Full Usage: averageByA mapping map

Parameters:
    mapping : 'K -> 'V -> aval<^T>
    map : amap<'K, 'V>

Returns: aval<^S>
Modifiers: inline
Type parameters: 'K, 'V, ^T, ^S

Adaptively computes the average of all values returned by mapping for the map.

mapping : 'K -> 'V -> aval<^T>
map : amap<'K, 'V>
Returns: aval<^S>

bind mapping value

Full Usage: bind mapping value

Parameters:
    mapping : 'T -> amap<'Key, 'Value>
    value : aval<'T>

Returns: amap<'Key, 'Value>

Adaptively maps over the given aval and returns the resulting map.

mapping : 'T -> amap<'Key, 'Value>
value : aval<'T>
Returns: amap<'Key, 'Value>

bind2 mapping valueA valueB

Full Usage: bind2 mapping valueA valueB

Parameters:
    mapping : 'A -> 'B -> amap<'Key, 'Value>
    valueA : aval<'A>
    valueB : aval<'B>

Returns: amap<'Key, 'Value>

Adaptively maps over the given avals and returns the resulting map.

mapping : 'A -> 'B -> amap<'Key, 'Value>
valueA : aval<'A>
valueB : aval<'B>
Returns: amap<'Key, 'Value>

bind3 mapping valueA valueB valueC

Full Usage: bind3 mapping valueA valueB valueC

Parameters:
    mapping : 'A -> 'B -> 'C -> amap<'Key, 'Value>
    valueA : aval<'A>
    valueB : aval<'B>
    valueC : aval<'C>

Returns: amap<'Key, 'Value>

Adaptively maps over the given avals and returns the resulting map.

mapping : 'A -> 'B -> 'C -> amap<'Key, 'Value>
valueA : aval<'A>
valueB : aval<'B>
valueC : aval<'C>
Returns: amap<'Key, 'Value>

choose mapping map

Full Usage: choose mapping map

Parameters:
    mapping : 'Key -> 'Value1 -> 'Value2 option
    map : amap<'Key, 'Value1>

Returns: amap<'Key, 'Value2>

Adaptively chooses all elements returned by mapping.

mapping : 'Key -> 'Value1 -> 'Value2 option
map : amap<'Key, 'Value1>
Returns: amap<'Key, 'Value2>

choose' mapping map

Full Usage: choose' mapping map

Parameters:
    mapping : 'Value1 -> 'Value2 option
    map : amap<'Key, 'Value1>

Returns: amap<'Key, 'Value2>

Adaptively chooses all elements returned by mapping without exposing keys.

mapping : 'Value1 -> 'Value2 option
map : amap<'Key, 'Value1>
Returns: amap<'Key, 'Value2>

choose2 mapping arg2 arg3

Full Usage: choose2 mapping arg2 arg3

Parameters:
    mapping : 'Key -> 'Value1 option -> 'Value2 option -> 'T option
    arg1 : amap<'Key, 'Value1>
    arg2 : amap<'Key, 'Value2>

Returns: amap<'Key, 'T>

Adaptively merges the two maps using the mapping specified. Note that mapping will always receive at least one *Some* argument.

mapping : 'Key -> 'Value1 option -> 'Value2 option -> 'T option
arg1 : amap<'Key, 'Value1>
arg2 : amap<'Key, 'Value2>
Returns: amap<'Key, 'T>

choose2V mapping arg2 arg3

Full Usage: choose2V mapping arg2 arg3

Parameters:
    mapping : 'Key -> 'Value1 voption -> 'Value2 voption -> 'T voption
    arg1 : amap<'Key, 'Value1>
    arg2 : amap<'Key, 'Value2>

Returns: amap<'Key, 'T>

Adaptively merges the two maps using the mapping specified. Note that mapping will always receive at least one *Some* argument.

mapping : 'Key -> 'Value1 voption -> 'Value2 voption -> 'T voption
arg1 : amap<'Key, 'Value1>
arg2 : amap<'Key, 'Value2>
Returns: amap<'Key, 'T>

chooseA mapping map

Full Usage: chooseA mapping map

Parameters:
    mapping : 'K -> 'V -> aval<'T option>
    map : amap<'K, 'V>

Returns: amap<'K, 'T>

Adaptively chooses all elements returned by mapping.

mapping : 'K -> 'V -> aval<'T option>
map : amap<'K, 'V>
Returns: amap<'K, 'T>

count arg1

Full Usage: count arg1

Parameters:
    arg0 : amap<'K, 'V>

Returns: aval<int>

Adaptively gets the number of elements in the map.

arg0 : amap<'K, 'V>
Returns: aval<int>

countBy predicate map

Full Usage: countBy predicate map

Parameters:
    predicate : 'K -> 'V -> bool
    map : amap<'K, 'V>

Returns: aval<int>

Adaptively counts all elements fulfilling the predicate

predicate : 'K -> 'V -> bool
map : amap<'K, 'V>
Returns: aval<int>

countByA predicate map

Full Usage: countByA predicate map

Parameters:
    predicate : 'K -> 'V -> aval<bool>
    map : amap<'K, 'V>

Returns: aval<int>

Adaptively counts all elements fulfilling the predicate

predicate : 'K -> 'V -> aval<bool>
map : amap<'K, 'V>
Returns: aval<int>

custom compute

Full Usage: custom compute

Parameters:
Returns: amap<'Key, 'Value>

Creates an amap using the given compute function

compute : AdaptiveToken -> HashMap<'Key, 'Value> -> HashMapDelta<'Key, 'Value>
Returns: amap<'Key, 'Value>

empty

Full Usage: empty

Returns: amap<'Key, 'Value>

The empty map.

Returns: amap<'Key, 'Value>

exists predicate map

Full Usage: exists predicate map

Parameters:
    predicate : 'K -> 'V -> bool
    map : amap<'K, 'V>

Returns: aval<bool>

Adaptively checks whether the predicate holds for at least one entry.

predicate : 'K -> 'V -> bool
map : amap<'K, 'V>
Returns: aval<bool>

existsA predicate map

Full Usage: existsA predicate map

Parameters:
    predicate : 'K -> 'V -> aval<bool>
    map : amap<'K, 'V>

Returns: aval<bool>

Adaptively checks whether the predicate holds for at least one entry.

predicate : 'K -> 'V -> aval<bool>
map : amap<'K, 'V>
Returns: aval<bool>

filter predicate map

Full Usage: filter predicate map

Parameters:
    predicate : 'Key -> 'Value -> bool
    map : amap<'Key, 'Value>

Returns: amap<'Key, 'Value>

Adaptively filters the set using the given predicate.

predicate : 'Key -> 'Value -> bool
map : amap<'Key, 'Value>
Returns: amap<'Key, 'Value>

filter' predicate map

Full Usage: filter' predicate map

Parameters:
    predicate : 'Value -> bool
    map : amap<'Key, 'Value>

Returns: amap<'Key, 'Value>

Adaptively filters the set using the given predicate without exposing keys.

predicate : 'Value -> bool
map : amap<'Key, 'Value>
Returns: amap<'Key, 'Value>

filterA predicate map

Full Usage: filterA predicate map

Parameters:
    predicate : 'K -> 'V -> aval<bool>
    map : amap<'K, 'V>

Returns: amap<'K, 'V>

Adaptively filters the list using the given predicate.

predicate : 'K -> 'V -> aval<bool>
map : amap<'K, 'V>
Returns: amap<'K, 'V>

find key map

Full Usage: find key map

Parameters:
    key : 'K
    map : amap<'K, 'V>

Returns: aval<'V>

Adaptively looks up the given key in the map. Note that this operation should not be used extensively since its resulting aval will be re-evaluated upon every change of the map. WARNING: causes KeyNotFoundException when the key is not present at evaluation-time

key : 'K
map : amap<'K, 'V>
Returns: aval<'V>

fold add zero map

Full Usage: fold add zero map

Parameters:
    add : 'S -> 'K -> 'V -> 'S
    zero : 'S
    map : amap<'K, 'V>

Returns: aval<'S>

Adaptively folds over the map using add for additions and recomputes the value on every removal. Note that the order of elements given to add is undefined.

add : 'S -> 'K -> 'V -> 'S
zero : 'S
map : amap<'K, 'V>
Returns: aval<'S>

foldGroup add subtract zero map

Full Usage: foldGroup add subtract zero map

Parameters:
    add : 'S -> 'K -> 'V -> 'S
    subtract : 'S -> 'K -> 'V -> 'S
    zero : 'S
    map : amap<'K, 'V>

Returns: aval<'S>

Adaptively folds over the map using add for additions and subtract for removals. Note that the order of elements given to add/subtract is undefined.

add : 'S -> 'K -> 'V -> 'S
subtract : 'S -> 'K -> 'V -> 'S
zero : 'S
map : amap<'K, 'V>
Returns: aval<'S>

foldHalfGroup add trySubtract zero map

Full Usage: foldHalfGroup add trySubtract zero map

Parameters:
    add : 'S -> 'K -> 'V -> 'S
    trySubtract : 'S -> 'K -> 'V -> 'S option
    zero : 'S
    map : amap<'K, 'V>

Returns: aval<'S>

Adaptively folds over the map using add for additions and trySubtract for removals. Note the trySubtract may return None indicating that the result needs to be recomputed. Also note that the order of elements given to add/trySubtract is undefined.

add : 'S -> 'K -> 'V -> 'S
trySubtract : 'S -> 'K -> 'V -> 'S option
zero : 'S
map : amap<'K, 'V>
Returns: aval<'S>

forall predicate map

Full Usage: forall predicate map

Parameters:
    predicate : 'K -> 'V -> bool
    map : amap<'K, 'V>

Returns: aval<bool>

Adaptively checks whether the predicate holds for all entries.

predicate : 'K -> 'V -> bool
map : amap<'K, 'V>
Returns: aval<bool>

forallA predicate map

Full Usage: forallA predicate map

Parameters:
    predicate : 'K -> 'V -> aval<bool>
    map : amap<'K, 'V>

Returns: aval<bool>

Adaptively checks whether the predicate holds for all entries.

predicate : 'K -> 'V -> aval<bool>
map : amap<'K, 'V>
Returns: aval<bool>

force arg1

Full Usage: force arg1

Parameters:
    arg0 : amap<'K, 'V>

Returns: HashMap<'K, 'V>

Evaluates the given adaptive map and returns its current content. This should not be used inside the adaptive evaluation of other AdaptiveObjects since it does not track dependencies.

arg0 : amap<'K, 'V>
Returns: HashMap<'K, 'V>

intersect arg1 arg2

Full Usage: intersect arg1 arg2

Parameters:
    arg0 : amap<'Key, 'Value1>
    arg1 : amap<'Key, 'Value2>

Returns: amap<'Key, ('Value1 * 'Value2)>

Adaptively intersects the two maps.

arg0 : amap<'Key, 'Value1>
arg1 : amap<'Key, 'Value2>
Returns: amap<'Key, ('Value1 * 'Value2)>

intersectV arg1 arg2

Full Usage: intersectV arg1 arg2

Parameters:
    arg0 : amap<'Key, 'Value1>
    arg1 : amap<'Key, 'Value2>

Returns: amap<'Key, ('Value1 * 'Value2)>

Adaptively intersects the two maps.

arg0 : amap<'Key, 'Value1>
arg1 : amap<'Key, 'Value2>
Returns: amap<'Key, ('Value1 * 'Value2)>

intersectWith mapping arg2 arg3

Full Usage: intersectWith mapping arg2 arg3

Parameters:
    mapping : 'Key -> 'Value1 -> 'Value2 -> 'T
    arg1 : amap<'Key, 'Value1>
    arg2 : amap<'Key, 'Value2>

Returns: amap<'Key, 'T>

Adaptively intersects the two maps while applying the given mapping function.

mapping : 'Key -> 'Value1 -> 'Value2 -> 'T
arg1 : amap<'Key, 'Value1>
arg2 : amap<'Key, 'Value2>
Returns: amap<'Key, 'T>

isEmpty arg1

Full Usage: isEmpty arg1

Parameters:
    arg0 : amap<'K, 'V>

Returns: aval<bool>

Adaptively tests if the map is empty.

arg0 : amap<'K, 'V>
Returns: aval<bool>

map mapping map

Full Usage: map mapping map

Parameters:
    mapping : 'Key -> 'Value1 -> 'Value2
    map : amap<'Key, 'Value1>

Returns: amap<'Key, 'Value2>

Adaptively maps over the given map.

mapping : 'Key -> 'Value1 -> 'Value2
map : amap<'Key, 'Value1>
Returns: amap<'Key, 'Value2>

map' mapping map

Full Usage: map' mapping map

Parameters:
    mapping : 'Value1 -> 'Value2
    map : amap<'Key, 'Value1>

Returns: amap<'Key, 'Value2>

Adaptively maps over the given map without exposing keys.

mapping : 'Value1 -> 'Value2
map : amap<'Key, 'Value1>
Returns: amap<'Key, 'Value2>

mapA mapping map

Full Usage: mapA mapping map

Parameters:
    mapping : 'K -> 'V -> aval<'T>
    map : amap<'K, 'V>

Returns: amap<'K, 'T>

Adaptively applies the given mapping function to all elements and returns a new amap containing the results.

mapping : 'K -> 'V -> aval<'T>
map : amap<'K, 'V>
Returns: amap<'K, 'T>

mapSet mapping set

Full Usage: mapSet mapping set

Parameters:
    mapping : 'Key -> 'Value
    set : aset<'Key>

Returns: amap<'Key, 'Value>

Creates an amap with the keys from the set and the values given by mapping.

mapping : 'Key -> 'Value
set : aset<'Key>
Returns: amap<'Key, 'Value>

mapUse mapping map

Full Usage: mapUse mapping map

Parameters:
    mapping : 'K -> 'A -> 'B
    map : amap<'K, 'A>

Returns: IDisposable * amap<'K, 'B>

Adaptively maps over the given map and disposes all removed values while active. Additionally the returned Disposable disposes all currently existing values and clears the resulting map.

mapping : 'K -> 'A -> 'B
map : amap<'K, 'A>
Returns: IDisposable * amap<'K, 'B>

ofASet elements

Full Usage: ofASet elements

Parameters:
    elements : aset<'Key * 'Value>

Returns: amap<'Key, HashSet<'Value>>

Creates an amap from the given set while keeping all duplicate values for a key in a HashSet.

elements : aset<'Key * 'Value>
Returns: amap<'Key, HashSet<'Value>>

ofASetIgnoreDuplicates elements

Full Usage: ofASetIgnoreDuplicates elements

Parameters:
    elements : aset<'Key * 'Value>

Returns: amap<'Key, 'Value>

Creates an amap from the given set and takes an arbitrary value for duplicate entries.

elements : aset<'Key * 'Value>
Returns: amap<'Key, 'Value>

ofAVal value

Full Usage: ofAVal value

Parameters:
Returns: amap<'Key, 'Value>

Creates an amap for the given aval.

value : aval<'a>
Returns: amap<'Key, 'Value>

ofArray elements

Full Usage: ofArray elements

Parameters:
    elements : ('Key * 'Value) array

Returns: amap<'Key, 'Value>

Creates an amap holding the given entries.

elements : ('Key * 'Value) array
Returns: amap<'Key, 'Value>

ofHashMap elements

Full Usage: ofHashMap elements

Parameters:
Returns: amap<'Key, 'Value>

Creates an amap holding the given entries.

elements : HashMap<'Key, 'Value>
Returns: amap<'Key, 'Value>

ofList elements

Full Usage: ofList elements

Parameters:
    elements : ('Key * 'Value) list

Returns: amap<'Key, 'Value>

Creates an amap holding the given entries.

elements : ('Key * 'Value) list
Returns: amap<'Key, 'Value>

ofReader creator

Full Usage: ofReader creator

Parameters:
    creator : unit -> 'a

Returns: amap<'Key, 'Value>

Creates an amap using the given reader-creator.

creator : unit -> 'a
Returns: amap<'Key, 'Value>

ofSeq elements

Full Usage: ofSeq elements

Parameters:
    elements : ('Key * 'Value) seq

Returns: amap<'Key, 'Value>

Creates an amap holding the given entries.

elements : ('Key * 'Value) seq
Returns: amap<'Key, 'Value>

reduce reduction map

Full Usage: reduce reduction map

Parameters:
Returns: aval<'Value>

Reduces the map using the given `AdaptiveReduction` and returns the resulting adaptive value.

reduction : AdaptiveReduction<'V, 'State, 'Value>
map : amap<'K, 'V>
Returns: aval<'Value>

reduceBy reduction mapping map

Full Usage: reduceBy reduction mapping map

Parameters:
Returns: aval<'Value>

Applies the mapping function to all elements of the map and reduces the results using the given `AdaptiveReduction`. Returns the resulting adaptive value.

reduction : AdaptiveReduction<'T2, 'State, 'Value>
mapping : 'K -> 'T1 -> 'T2
map : amap<'K, 'T1>
Returns: aval<'Value>

reduceByA reduction mapping map

Full Usage: reduceByA reduction mapping map

Parameters:
Returns: aval<'Value>

Applies the mapping function to all elements of the map and reduces the results using the given `AdaptiveReduction`. Returns the resulting adaptive value.

reduction : AdaptiveReduction<'T2, 'State, 'Value>
mapping : 'K -> 'T1 -> aval<'T2>
map : amap<'K, 'T1>
Returns: aval<'Value>

single key value

Full Usage: single key value

Parameters:
    key : 'Key
    value : 'Value

Returns: amap<'Key, 'Value>

A constant amap holding a single key/value.

key : 'Key
value : 'Value
Returns: amap<'Key, 'Value>

sumBy mapping map

Full Usage: sumBy mapping map

Parameters:
    mapping : 'K -> 'V -> ^T
    map : amap<'K, 'V>

Returns: aval<^S>
Modifiers: inline
Type parameters: 'K, 'V, ^T, ^S

Adaptively computes the sum of all values returned by mapping for the map.

mapping : 'K -> 'V -> ^T
map : amap<'K, 'V>
Returns: aval<^S>

sumByA mapping map

Full Usage: sumByA mapping map

Parameters:
    mapping : 'K -> 'V -> aval<^T>
    map : amap<'K, 'V>

Returns: aval<^S>
Modifiers: inline
Type parameters: 'K, 'V, ^T, ^S

Adaptively computes the sum of all values returned by mapping for the map.

mapping : 'K -> 'V -> aval<^T>
map : amap<'K, 'V>
Returns: aval<^S>

toASet map

Full Usage: toASet map

Parameters:
    map : amap<'Key, 'Value>

Returns: aset<'Key * 'Value>

Creates an aset holding all key/value tuples from the map.

map : amap<'Key, 'Value>
Returns: aset<'Key * 'Value>

toASetValues map

Full Usage: toASetValues map

Parameters:
    map : amap<'Key, 'Value>

Returns: aset<'Value>

Creates an aset holding all distinct values from the map.

map : amap<'Key, 'Value>
Returns: aset<'Value>

toAVal map

Full Usage: toAVal map

Parameters:
    map : amap<'Key, 'Value>

Returns: aval<HashMap<'Key, 'Value>>

Creates an aval providing access to the current content of the map.

map : amap<'Key, 'Value>
Returns: aval<HashMap<'Key, 'Value>>

tryFind key map

Full Usage: tryFind key map

Parameters:
    key : 'K
    map : amap<'K, 'V>

Returns: aval<'V option>

Adaptively looks up the given key in the map. Note that this operation should not be used extensively since its resulting aval will be re-evaluated upon every change of the map.

key : 'K
map : amap<'K, 'V>
Returns: aval<'V option>

union a b

Full Usage: union a b

Parameters:
    a : amap<'Key, 'Value>
    b : amap<'Key, 'Value>

Returns: amap<'Key, 'Value>

Adaptively unions both maps preferring the right value when colliding entries are found.

a : amap<'Key, 'Value>
b : amap<'Key, 'Value>
Returns: amap<'Key, 'Value>

unionWith resolve a b

Full Usage: unionWith resolve a b

Parameters:
    resolve : 'Key -> 'Value -> 'Value -> 'Value
    a : amap<'Key, 'Value>
    b : amap<'Key, 'Value>

Returns: amap<'Key, 'Value>

Adaptively unions both maps using the given resolve functions when colliding entries are found.

resolve : 'Key -> 'Value -> 'Value -> 'Value
a : amap<'Key, 'Value>
b : amap<'Key, 'Value>
Returns: amap<'Key, 'Value>

Type something to start searching.