ron-rdt-0.8: Replicated Data Types (RON-RDT)

Safe HaskellNone
LanguageHaskell2010

RON.Data.LWW

Description

LWW-per-field RDT

Synopsis

Documentation

newtype LwwRep Source #

Untyped LWW. Implementation: a map from opRef to the original op.

Constructors

LwwRep (Map UUID Op) 
Instances
Eq LwwRep Source # 
Instance details

Defined in RON.Data.LWW

Methods

(==) :: LwwRep -> LwwRep -> Bool #

(/=) :: LwwRep -> LwwRep -> Bool #

Show LwwRep Source # 
Instance details

Defined in RON.Data.LWW

Semigroup LwwRep Source # 
Instance details

Defined in RON.Data.LWW

Monoid LwwRep Source # 
Instance details

Defined in RON.Data.LWW

Semilattice LwwRep Source #

Laws: 1. Idempotent because unionWith is idempotent. 2. Commutative because lww is commutative.

Instance details

Defined in RON.Data.LWW

Reducible LwwRep Source # 
Instance details

Defined in RON.Data.LWW

Methods

reducibleOpType :: UUID Source #

stateFromChunk :: [Op] -> LwwRep Source #

stateToChunk :: LwwRep -> [Op] Source #

applyPatches :: LwwRep -> Unapplied -> (LwwRep, Unapplied) Source #

reduceUnappliedPatches :: Unapplied -> Unapplied Source #

assignField Source #

Arguments

:: (Replicated a, ReplicaClock m, MonadE m, MonadObjectState struct m) 
=> UUID

Field name

-> Maybe a

Value

-> m () 

Assign a value to a field

lwwType :: UUID Source #

Name-UUID to use as LWW type marker.

newStruct :: (MonadState StateFrame m, ReplicaClock m) => [(UUID, Maybe (Instance Replicated))] -> m UUID Source #

Create an LWW object from a list of named fields.

readField Source #

Arguments

:: (MonadE m, MonadObjectState struct m, Rep struct ~ LwwRep, Replicated field) 
=> UUID

Field name

-> m (Maybe field) 

Read field value

viewField Source #

Arguments

:: (Replicated a, MonadE m, MonadState StateFrame m) 
=> UUID

Field name

-> StateChunk LwwRep

LWW object chunk

-> m (Maybe a) 

Decode field value

zoomField Source #

Arguments

:: (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