Logo Mibo

CMap Module

Operations on changeable maps.

Functions and values

Function or value Description

addOrUpdate key value mapValue

Full Usage: addOrUpdate key value mapValue

Parameters:
    key : 'K
    value : 'V
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Adds or updates an entry. No-op when the value is unchanged.

key : 'K
value : 'V
mapValue : cmap<'K, 'V>

clear mapValue

Full Usage: clear mapValue

Parameters:
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Removes all entries (FDA cmap.Clear parity; one atomic batch).

mapValue : cmap<'K, 'V>

containsKey key mapValue

Full Usage: containsKey key mapValue

Parameters:
    key : 'K
    mapValue : cmap<'K, 'V>

Returns: bool
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Tests whether the key is present (FDA cmap.ContainsKey parity).

key : 'K
mapValue : cmap<'K, 'V>
Returns: bool

empty

Full Usage: empty

Returns: cmap<'K, 'V>
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

An empty changeable map.

Returns: cmap<'K, 'V>

force mapValue

Full Usage: force mapValue

Parameters:
    mapValue : cmap<'K, 'V>

Returns: FrozenDictionary<'K, 'V>
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Materializes the current state as an immutable snapshot.

mapValue : cmap<'K, 'V>
Returns: FrozenDictionary<'K, 'V>

item key mapValue

Full Usage: item key mapValue

Parameters:
    key : 'K
    mapValue : cmap<'K, 'V>

Returns: 'V
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Gets the value for the key (FDA cmap.Item parity; KeyNotFoundException when absent).

key : 'K
mapValue : cmap<'K, 'V>
Returns: 'V

ofSeq items

Full Usage: ofSeq items

Parameters:
    items : ('K * 'V) seq

Returns: cmap<'K, 'V>
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

A changeable map with the given entries.

items : ('K * 'V) seq
Returns: cmap<'K, 'V>

perform delta mapValue

Full Usage: perform delta mapValue

Parameters:
Type parameters: 'K, 'V (requires equality)

Applies a batch of map operations (FDA cmap.Perform parity). The batch is applied atomically: sinks receive one net delta.

delta : MapDeltaBuilder<'K, 'V>
mapValue : cmap<'K, 'V>

postAddOrUpdate key value mapValue

Full Usage: postAddOrUpdate key value mapValue

Parameters:
    key : 'K
    value : 'V
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Posts an add or update (the cval.Post handoff pattern): queues the operation and returns immediately. Safe from any thread. The owner thread applies the queued operations at the next graph operation (reads and writes auto-drain) or at Posting.pump, as one batch: one net delta, one notification delivery. A burst is coalesced into a single handoff.

key : 'K
value : 'V
mapValue : cmap<'K, 'V>
Example

 // worker thread
 CMap.postAddOrUpdate key value map
 // owner thread: the next read applies the post automatically
 let view = AMap.force map
val view: obj

postClear mapValue

Full Usage: postClear mapValue

Parameters:
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Posts a clear (a full replace with the empty map). Safe from any thread. See postAddOrUpdate for the application contract.

mapValue : cmap<'K, 'V>

postRemove key mapValue

Full Usage: postRemove key mapValue

Parameters:
    key : 'K
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Posts a remove. Safe from any thread. See postAddOrUpdate for the application contract.

key : 'K
mapValue : cmap<'K, 'V>

postSet value mapValue

Full Usage: postSet value mapValue

Parameters:
    value : ('K * 'V) seq
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Posts a full replace. Safe from any thread. See postAddOrUpdate for the application contract; a posted replace supersedes the other ops of the same pending batch (the transaction semantics of set). The content is passed as a seq so the posting thread allocates nothing: convert a Map with Map.toSeq at the call site when needed.

value : ('K * 'V) seq
mapValue : cmap<'K, 'V>

remove key mapValue

Full Usage: remove key mapValue

Parameters:
    key : 'K
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Removes an entry. No-op when absent.

key : 'K
mapValue : cmap<'K, 'V>

set value mapValue

Full Usage: set value mapValue

Parameters:
    value : Map<'K, 'V>
    mapValue : cmap<'K, 'V>

Modifiers: inline
Type parameters: 'K, 'V (requires comparison)

Replaces the whole map.

value : Map<'K, 'V>
mapValue : cmap<'K, 'V>

toMap mapValue

Full Usage: toMap mapValue

Parameters:
    mapValue : cmap<'K, 'V>

Returns: Map<'K, 'V>
Modifiers: inline
Type parameters: 'K, 'V (requires comparison)

Materializes the F# Map counterpart.

mapValue : cmap<'K, 'V>
Returns: Map<'K, 'V>

tryGetValue key mapValue

Full Usage: tryGetValue key mapValue

Parameters:
    key : 'K
    mapValue : cmap<'K, 'V>

Returns: 'V voption
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Gets the value for the key, or ValueNone when absent (FDA cmap.TryGetValue parity).

key : 'K
mapValue : cmap<'K, 'V>
Returns: 'V voption

updateTo target mapValue

Full Usage: updateTo target mapValue

Parameters:
    target : ('K * 'V) seq
    mapValue : cmap<'K, 'V>

Returns: bool
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Replaces the whole map and returns whether the content changed (FDA cmap.UpdateTo parity; deviation: FDA merges with init/update, we replace, matching set). An equal target marks nothing.

target : ('K * 'V) seq
mapValue : cmap<'K, 'V>
Returns: bool

value mapValue

Full Usage: value mapValue

Parameters:
    mapValue : cmap<'K, 'V>

Returns: amap<'K, 'V>
Modifiers: inline
Type parameters: 'K, 'V (requires equality)

Views the changeable map as an adaptive map.

mapValue : cmap<'K, 'V>
Returns: amap<'K, 'V>

Type something to start searching.