Safe Haskell | Safe-Infered |
---|

- data VectorClock a b
- empty :: VectorClock a b
- singleton :: a -> b -> VectorClock a b
- fromList :: Ord a => [(a, b)] -> VectorClock a b
- null :: VectorClock a b -> Bool
- size :: VectorClock a b -> Int
- member :: Ord a => a -> VectorClock a b -> Bool
- lookup :: Ord a => a -> VectorClock a b -> Maybe b
- insert :: Ord a => a -> b -> VectorClock a b -> VectorClock a b
- delete :: Ord a => a -> VectorClock a b -> VectorClock a b
- combine :: (Ord a, Ord b) => (a -> Maybe b -> Maybe b -> Maybe b) -> VectorClock a b -> VectorClock a b -> VectorClock a b
- max :: (Ord a, Ord b) => VectorClock a b -> VectorClock a b -> VectorClock a b
- relation :: (Ord a, Ord b) => VectorClock a b -> VectorClock a b -> Relation
- valid :: (Ord a, Ord b) => VectorClock a b -> Bool

# Vector clock type

data VectorClock a b Source

A vector clock is, conceptually, an associtive list sorted by the value of the key, where each key appears only once.

(Eq a, Eq b) => Eq (VectorClock a b) | |

(Show a, Show b) => Show (VectorClock a b) | |

(Binary a, Binary b) => Binary (VectorClock a b) |

# Construction

empty :: VectorClock a bSource

The empty vector clock.

singleton :: a -> b -> VectorClock a bSource

A vector clock with a single element.

fromList :: Ord a => [(a, b)] -> VectorClock a bSource

Insert each entry in the list one at a time.

# Query

null :: VectorClock a b -> BoolSource

Is the vector clock empty?

size :: VectorClock a b -> IntSource

The number of entries in the vector clock.

member :: Ord a => a -> VectorClock a b -> BoolSource

Is the given key a key in an entry of the vector clock?

lookup :: Ord a => a -> VectorClock a b -> Maybe bSource

Lookup the value for a key in the vector clock.

# Insertion

insert :: Ord a => a -> b -> VectorClock a b -> VectorClock a bSource

Insert or replace the entry for a key.

# Delete

delete :: Ord a => a -> VectorClock a b -> VectorClock a bSource

Delete an entry from the vector clock. If the requested entry does not exist, does nothing.

# Merges

combine :: (Ord a, Ord b) => (a -> Maybe b -> Maybe b -> Maybe b) -> VectorClock a b -> VectorClock a b -> VectorClock a bSource

Combine two vector clocks entry-by-entry.

max :: (Ord a, Ord b) => VectorClock a b -> VectorClock a b -> VectorClock a bSource

The maximum of the two vector clocks.

# Relations

relation :: (Ord a, Ord b) => VectorClock a b -> VectorClock a b -> RelationSource

The relation between the two vector clocks.