crdt-0.4: Conflict-free replicated data types

Safe HaskellSafe
LanguageHaskell2010

CRDT.Cm

Synopsis

Documentation

class CmRDT op where Source #

Operation-based, or commutative (Cm) replicated data type.

Commutativity law
update op1 . update op2 == update op2 . update op1

Idempotency doesn't need to hold.

Minimal complete definition

update

Associated Types

type State op :: Type Source #

The type of the target value

Methods

update :: op -> State op -> State op Source #

Apply operation to a value

Instances

Num a => CmRDT (GCounter a) Source # 

Associated Types

type State (GCounter a) :: Type Source #

Methods

update :: GCounter a -> State (GCounter a) -> State (GCounter a) Source #

Ord a => CmRDT (LWW a) Source # 

Associated Types

type State (LWW a) :: Type Source #

Methods

update :: LWW a -> State (LWW a) -> State (LWW a) Source #

Num a => CmRDT (PNCounter a) Source # 

Associated Types

type State (PNCounter a) :: Type Source #