| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
CRDT.LWW
Contents
Documentation
Last write wins. Assuming timestamp is unique.
This type is both CmRDT and CvRDT.
Timestamps are assumed unique, totally ordered, and consistent with causal order; i.e., if assignment 1 happened-before assignment 2, the former’s timestamp is less than the latter’s.
Constructors
| LWW | |
Fields
| |
Instances
| Eq a => Eq (LWW a) Source # | |
| Show a => Show (LWW a) Source # | |
| Eq a => Semigroup (LWW a) Source # | Merge by choosing more recent timestamp. |
| Eq a => Semilattice (LWW a) Source # | See |
Defined in CRDT.LWW | |
| Eq a => CmRDT (LWW a) Source # | |
| CausalOrd (LWW a) Source # | |
| type Intent (LWW a) Source # | |
| type Payload (LWW a) Source # | |
CvRDT
initialize :: Clock m => a -> m (LWW a) Source #
Initialize state
assign :: Clock m => a -> LWW a -> m (LWW a) Source #
Change state as CvRDT operation. Current value is ignored, because new timestamp is always greater.
Implementation detail
advanceFromLWW :: Clock m => LWW a -> m () Source #