Safe Haskell | None |
---|---|
Language | Haskell2010 |
LWW-per-field RDT
Synopsis
- newtype LwwRep = LwwRep (Map UUID Op)
- assignField :: (Replicated a, ReplicaClock m, MonadE m, MonadObjectState struct m) => UUID -> Maybe a -> m ()
- lwwType :: UUID
- newStruct :: (MonadState StateFrame m, ReplicaClock m) => [(UUID, Maybe (Instance Replicated))] -> m UUID
- readField :: (MonadE m, MonadObjectState struct m, Rep struct ~ LwwRep, Replicated field) => UUID -> m (Maybe field)
- viewField :: (Replicated a, MonadE m, MonadState StateFrame m) => UUID -> StateChunk LwwRep -> m (Maybe a)
- zoomField :: (MonadE m, ReplicatedAsObject struct) => UUID -> ObjectStateT field m a -> ObjectStateT struct m a
Documentation
Untyped LWW. Implementation: a map from opRef
to the original op.
Instances
Eq LwwRep Source # | |
Show LwwRep Source # | |
Semigroup LwwRep Source # | |
Monoid LwwRep Source # | |
Semilattice LwwRep Source # | Laws:
1. Idempotent because |
Defined in RON.Data.LWW | |
Reducible LwwRep Source # | |
Defined in RON.Data.LWW reducibleOpType :: UUID Source # stateFromChunk :: [Op] -> LwwRep Source # stateToChunk :: LwwRep -> [Op] Source # applyPatches :: LwwRep -> Unapplied -> (LwwRep, Unapplied) Source # reduceUnappliedPatches :: Unapplied -> Unapplied Source # |
:: (Replicated a, ReplicaClock m, MonadE m, MonadObjectState struct m) | |
=> UUID | Field name |
-> Maybe a | Value |
-> m () |
Assign a value to a field
newStruct :: (MonadState StateFrame m, ReplicaClock m) => [(UUID, Maybe (Instance Replicated))] -> m UUID Source #
Create an LWW object from a list of named fields.
:: (MonadE m, MonadObjectState struct m, Rep struct ~ LwwRep, Replicated field) | |
=> UUID | Field name |
-> m (Maybe field) |
Read field value
:: (Replicated a, MonadE m, MonadState StateFrame m) | |
=> UUID | Field name |
-> StateChunk LwwRep | LWW object chunk |
-> m (Maybe a) |
Decode field value
:: (MonadE m, ReplicatedAsObject struct) | |
=> UUID | Field name |
-> ObjectStateT field m a | Inner object modifier |
-> ObjectStateT struct m a |
Pseudo-lens to an object inside a specified field