AMap Module
Operations on adaptive maps.
Functions and values
| Function or value |
Description
|
Full Usage:
averageBy mapping mapValue
Parameters:
'k -> 'v -> ^u
mapValue : amap<'k, 'v>
Returns: aval<^u>
Modifiers: inline Type parameters: 'k, 'v, ^u (requires equality and (static member DivideByInt : ^u * Microsoft.FSharp.Core.int -> ^u) and (static member get_Zero : -> ^u) and (static member op_Addition : ^u * ^u -> ^u) and (static member op_Subtraction : ^u * ^u -> ^u)) |
|
Full Usage:
averageByA mapping mapValue
Parameters: Returns: aval<^U>
Modifiers: inline Type parameters: 'K, 'V, ^U (requires equality and (static member DivideByInt : ^U * Microsoft.FSharp.Core.int -> ^U) and (static member get_Zero : -> ^U) and (static member op_Addition : ^U * ^U -> ^U) and (static member op_Subtraction : ^U * ^U -> ^U)) |
|
|
Adaptively maps over the given value and returns the resulting map (FDA
Example
val selected: obj
val tables: obj array
Multiple items
val string: value: 'T -> string -------------------- type string = System.String Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val visible: obj
|
|
Adaptively maps over the two values and returns the resulting map (FDA
|
|
|
|
Merges both maps with a mapping that receives the key and both side
values (voptions) and returns the output value (voption). The mapping
is called only when at least one side has a value (FDA parity); a key
with no value on either side is removed without a call. Voption-first:
this is FDA's
|
|
Merges both maps with a mapping that receives the key and both side
values (voptions) and returns the output value (voption). The mapping
is called only when at least one side has a value (FDA parity); a key
with no value on either side is removed without a call. Voption-first:
this is FDA's
|
|
|
|
|
|
|
Full Usage:
constant create
Parameters:
unit -> Dictionary<'K, 'V>
Returns: amap<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
An adaptive map whose content is fixed but computed lazily, once, at
first read. Enables self-referential definitions (FDA parity: the
create function runs at most once; deviation: FDA's create returns a
|
|
|
|
|
|
|
Full Usage:
custom compute
Parameters:
IReadOnlyDictionary<'K, 'V> -> MapDeltaBuilder<'K, 'V> -> unit
Returns: amap<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
An adaptive map driven by a compute function (FDA
|
Full Usage:
delay create
Parameters:
unit -> Dictionary<'K, 'V>
Returns: amap<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
Alias of constant (symmetry with
|
|
|
An empty adaptive map (FDA
|
|
|
|
|
|
|
|
|
|
|
|
|
Adaptively looks up the key. Reading the value throws KeyNotFoundException when the key is absent. Per-key precise, like tryFind.
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
force mapValue
Parameters:
amap<'K, 'V>
Returns: FrozenDictionary<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
Materializes the current state as an immutable FrozenDictionary<'K,'V>. This is the only collection operation that allocates; the result is safe to retain and the library never touches it again. Runs the pending delta processing (drain) first.
|
Full Usage:
getValue mapValue
Parameters:
amap<'K, 'V>
Returns: IReadOnlyDictionary<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
Returns a transient view of the current state. Valid only until the next write on the owner thread; do not retain or mutate it. Use force to materialize a snapshot that is safe to retain.
|
|
Groups the entries of a map by a computed key (FDA
Example
val byAuthor: obj
val counts: obj
|
|
|
|
|
|
|
|
|
Full Usage:
joinOn left right keyOfLeft mapping
Parameters:
amap<'K1, 'V1>
right : amap<'K2, 'V2>
keyOfLeft : 'K1 -> 'V1 -> 'K2
mapping : 'K1 -> aval<'V1> -> aval<'V2 voption> -> aval<'U voption>
Returns: amap<'K1, 'U>
Modifiers: inline Type parameters: 'K1, 'V1, 'K2, 'V2, 'U (requires equality and equality) |
Equi-joins two maps on a computed key (the map analog of
The per-key subgraph is built once and updated in place: a left update
re-applies a swappable value cell (no rebuild, no per-frame
allocation), and a join-key change (rare) re-runs the mapping against
the new lookup. Right-map changes reach the entries through the lookup
(read-time gate) on the next read. A left-join is the
Example
val orderViews: obj
union case ValueOption.ValueSome: 'T -> ValueOption<'T>
Multiple items
module ValueOption from Microsoft.FSharp.Core -------------------- type ValueOption<'T> = | ValueNone | ValueSome of 'T static member Some: value: 'T -> 'T voption static member op_Implicit: value: 'T -> 'T voption member IsNone: bool member IsSome: bool member Value: 'T static member None: 'T voption val defaultValue: value: 'T -> voption: 'T voption -> 'T
|
|
|
|
|
|
|
|
|
Full Usage:
mapUse mapping mapValue
Parameters:
'K -> 'V -> 'W
mapValue : amap<'K, 'V>
Returns: IDisposable * amap<'K, 'W>
Modifiers: inline Type parameters: 'K, 'V, 'W (requires equality and equality and :> System.IDisposable) |
Maps every entry, disposing the mapped value when its key leaves (FDA
Example
val src: obj
val cleanup: obj
val mapped: obj
val id: x: 'T -> 'T
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
ofArray items
Parameters:
('K * 'V)[]
Returns: amap<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
|
Full Usage:
ofExternal snapshot
Parameters:
unit -> IReadOnlyDictionary<'K, 'V>
Returns: amap<'K, 'V> * (unit -> unit)
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
Creates an adaptive map from an external snapshot function and an
invalidate handle (FDA
Example
val mutable current: System.Collections.Generic.IDictionary<int,string>
val dict: keyValuePairs: ('Key * 'Value) seq -> System.Collections.Generic.IDictionary<'Key,'Value> (requires equality)
val map: obj
val invalidate: (unit -> obj)
val forced: obj
|
Full Usage:
ofList items
Parameters:
('K * 'V) list
Returns: amap<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
|
|
|
Full Usage:
ofSeq items
Parameters:
('K * 'V) seq
Returns: amap<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
|
Full Usage:
reduce reduction mapValue
Parameters:
AdaptiveReduction<'a, 's, 'v>
mapValue : amap<'k, 'a>
Returns: aval<'v>
Modifiers: inline Type parameters: 'a, 's, 'v, 'k (requires equality) |
Adaptively reduces the map with the given AdaptiveReduction over the values. The state is updated incrementally from deltas: a Set on an existing key subtracts the old value, then adds the new one.
|
Full Usage:
reduceBy reduction mapping mapValue
Parameters:
AdaptiveReduction<'b, 's, 'v>
mapping : 'k -> 'a -> 'b
mapValue : amap<'k, 'a>
Returns: aval<'v>
Modifiers: inline Type parameters: 'b, 's, 'v, 'k, 'a (requires equality) |
Maps every entry, then reduces the mapped values with the given AdaptiveReduction. The mapping runs per delta entry.
|
Full Usage:
reduceByA reduction mapping mapValue
Parameters:
AdaptiveReduction<'U, 's, 'v>
mapping : 'K -> 'V -> aval<'U>
mapValue : amap<'K, 'V>
Returns: aval<'v>
Modifiers: inline Type parameters: 'U, 's, 'v, 'K, 'V (requires equality) |
Adaptively reduces the map after mapping every entry to an adaptive
value (the AMap counterpart of
|
Full Usage:
single key value
Parameters:
'K
value : 'V
Returns: amap<'K, 'V>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
|
Full Usage:
sumBy mapping mapValue
Parameters:
'k -> 'v -> ^u
mapValue : amap<'k, 'v>
Returns: aval<^u>
Modifiers: inline Type parameters: 'k, 'v, ^u (requires equality and (static member get_Zero : -> ^u) and (static member op_Addition : ^u * ^u -> ^u) and (static member op_Subtraction : ^u * ^u -> ^u)) |
|
Full Usage:
sumByA mapping mapValue
Parameters: Returns: aval<^U>
Modifiers: inline Type parameters: 'K, 'V, ^U (requires equality and (static member get_Zero : -> ^U) and (static member op_Addition : ^U * ^U -> ^U) and (static member op_Subtraction : ^U * ^U -> ^U)) |
|
|
|
|
|
|
|
Full Usage:
toAVal mapValue
Parameters:
amap<'K, 'V>
Returns: aval<FrozenDictionary<'K, 'V>>
Modifiers: inline Type parameters: 'K, 'V (requires equality) |
Materializes the map as an adaptive value. Every change materializes a new immutable FrozenDictionary<'K,'V> (the retain boundary, like force); the value is safe to retain.
|
|
|
|
Adaptively looks up the key: the value, or
|
|
|
|
|
|
|
|
Mibo