crdt-3.0: Conflict-free replicated data types

Safe HaskellNone
LanguageHaskell2010

CRDT.LamportClock

Contents

Synopsis

Documentation

newtype Pid Source #

Unique process identifier

Constructors

Pid Int 

Instances

Eq Pid Source # 

Methods

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

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

Ord Pid Source # 

Methods

compare :: Pid -> Pid -> Ordering #

(<) :: Pid -> Pid -> Bool #

(<=) :: Pid -> Pid -> Bool #

(>) :: Pid -> Pid -> Bool #

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

max :: Pid -> Pid -> Pid #

min :: Pid -> Pid -> Pid #

Show Pid Source # 

Methods

showsPrec :: Int -> Pid -> ShowS #

show :: Pid -> String #

showList :: [Pid] -> ShowS #

Lamport timestamp (for a single process)

Lamport clock (for a whole multi-process system)

newtype LamportClock a Source #

Key is Pid. Non-present value is equivalent to 0.

Constructors

LamportClock (State (IntMap LocalTime) a) 

Process

newtype Process a Source #

Constructors

Process (ReaderT Pid LamportClock a) 

Instances

Monad Process Source # 

Methods

(>>=) :: Process a -> (a -> Process b) -> Process b #

(>>) :: Process a -> Process b -> Process b #

return :: a -> Process a #

fail :: String -> Process a #

Functor Process Source # 

Methods

fmap :: (a -> b) -> Process a -> Process b #

(<$) :: a -> Process b -> Process a #

Applicative Process Source # 

Methods

pure :: a -> Process a #

(<*>) :: Process (a -> b) -> Process a -> Process b #

(*>) :: Process a -> Process b -> Process b #

(<*) :: Process a -> Process b -> Process a #