-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Vector clocks for versioning message flows -- -- The vector-clock library provides a ready to use implementation of the -- vector clock data-structures, which may be used to version messages -- and determine causality relations between messages in a distributed -- system. -- -- See Fundamentals of Distributed Computing: A Practical Tour of -- Vector Clock Systems by Baldoni and Raynal for an overview of -- vector clocks. -- -- See the README.md file for details. @package vector-clock @version 0.1.0 module Data.VectorClock -- | A vector clock is, conceptually, an associtive list sorted by the -- value of the key, where each key appears only once. data VectorClock a b -- | The empty vector clock. empty :: VectorClock a b -- | A vector clock with a single element. singleton :: a -> b -> VectorClock a b -- | Insert each entry in the list one at a time. fromList :: Ord a => [(a, b)] -> VectorClock a b -- | Is the vector clock empty? null :: VectorClock a b -> Bool -- | The number of entries in the vector clock. size :: VectorClock a b -> Int -- | Is the given key a key in an entry of the vector clock? member :: Ord a => a -> VectorClock a b -> Bool -- | Lookup the value for a key in the vector clock. lookup :: Ord a => a -> VectorClock a b -> Maybe b -- | Insert or replace the entry for a key. insert :: Ord a => a -> b -> VectorClock a b -> VectorClock a b -- | Delete an entry from the vector clock. If the requested entry does not -- exist, does nothing. delete :: Ord a => a -> VectorClock a b -> VectorClock a b -- | Combine two vector clocks entry-by-entry. combine :: (Ord a, Ord b) => (a -> Maybe b -> Maybe b -> Maybe b) -> VectorClock a b -> VectorClock a b -> VectorClock a b -- | The maximum of the two vector clocks. max :: (Ord a, Ord b) => VectorClock a b -> VectorClock a b -> VectorClock a b -- | The relation between the two vector clocks. relation :: (Ord a, Ord b) => VectorClock a b -> VectorClock a b -> Relation -- | Check whether the vector clock is valid or not. valid :: (Ord a, Ord b) => VectorClock a b -> Bool instance (Eq a, Eq b) => Eq (VectorClock a b) instance Eq Relation instance Show Relation instance (Binary a, Binary b) => Binary (VectorClock a b) instance (Show a, Show b) => Show (VectorClock a b)