ChangeableSet<'T> Type
A changeable set: the writable source of an adaptive set. Reads and writes are confined to the owner thread.
Writes inside a Transaction.run are journaled in order and applied at
commit as one net delta: adds and removes of the same element in one batch
cancel, and the last write wins. Reads inside a transaction see the
pre-transaction state.
GetValue returns a transient view of the internal state, valid only
until the next write. CSet.force materializes an immutable snapshot.
Constructors
| Constructor |
Description
|
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.Add
Parameters:
'T
|
Adds an element. No-op when already present.
|
Full Usage:
this.PostAdd
Parameters:
'T
|
Posts an add. Safe from any thread: the operation is queued and
returns immediately. The owner thread applies the queued operations at
the next graph operation (reads and writes auto-drain) or at
Example
val view: obj
|
Full Usage:
this.PostRemove
Parameters:
'T
|
Posts a remove. Safe from any thread. See PostAdd for the application contract.
Example
|
Full Usage:
this.PostSet
Parameters:
'T seq
|
Example
Multiple items
module Set from Microsoft.FSharp.Collections -------------------- type Set<'T (requires comparison)> = interface IReadOnlyCollection<'T> interface IStructuralEquatable interface IComparable interface IEnumerable interface IEnumerable<'T> interface ICollection<'T> new: elements: 'T seq -> Set<'T> member Add: value: 'T -> Set<'T> member Contains: value: 'T -> bool member IsProperSubsetOf: otherSet: Set<'T> -> bool ... -------------------- new: elements: 'T seq -> Set<'T> val ofList: elements: 'T list -> Set<'T> (requires comparison)
|
Full Usage:
this.Remove
Parameters:
'T
|
Removes an element. No-op when absent.
|
Full Usage:
this.Set
Parameters:
'T seq
|
Replaces the whole set. Supersedes the whole batch inside a transaction (later writes of the batch are discarded; matches the list, docs/ALIST-DESIGN.md ยง3.3).
|
Mibo