crdt-1.0: Conflict-free replicated data types

Safe HaskellNone
LanguageHaskell2010

CRDT.Cv.LWW

Synopsis

Documentation

data LWW a Source #

Last write wins. Assuming timestamp is unique.

Constructors

LWW 

Fields

Instances

Eq (LWW a) Source # 

Methods

(==) :: LWW a -> LWW a -> Bool #

(/=) :: LWW a -> LWW a -> Bool #

Ord (LWW a) Source # 

Methods

compare :: LWW a -> LWW a -> Ordering #

(<) :: LWW a -> LWW a -> Bool #

(<=) :: LWW a -> LWW a -> Bool #

(>) :: LWW a -> LWW a -> Bool #

(>=) :: LWW a -> LWW a -> Bool #

max :: LWW a -> LWW a -> LWW a #

min :: LWW a -> LWW a -> LWW a #

Show a => Show (LWW a) Source # 

Methods

showsPrec :: Int -> LWW a -> ShowS #

show :: LWW a -> String #

showList :: [LWW a] -> ShowS #

Semigroup (LWW a) Source #

Merge by choosing more recent timestamp.

Methods

(<>) :: LWW a -> LWW a -> LWW a #

sconcat :: NonEmpty (LWW a) -> LWW a #

stimes :: Integral b => b -> LWW a -> LWW a #

Semilattice (LWW a) Source # 
type Observed (LWW a) Source # 
type Observed (LWW a) = a

initial :: Clock f => a -> f (LWW a) Source #

Initialize state

assign :: Clock f => a -> LWW a -> f (LWW a) Source #

Change state

query :: LWW a -> a Source #

Query state