crdt-2.1: Conflict-free replicated data types

Safe HaskellSafe
LanguageHaskell2010

LamportClock

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 #

Clock Process Source # 

type Time = Word Source #

data Timestamp Source #

Timestamps are assumed unique, totally ordered, and consistent with causal order; i.e., if assignment 1 happened-before assignment 2, the former’s timestamp is less than the latter’s.

Constructors

Timestamp !Time !Pid 

class Applicative f => Clock f where Source #

Minimal complete definition

newTimestamp

Methods

newTimestamp :: f Timestamp Source #

Get another unique timestamp

type LamportClock = State LamportTime Source #

barrier :: [Pid] -> LamportClock () Source #

XXX Make sure all subsequent calls to newTimestamp return timestamps greater than all prior calls.