Portability | portable |
---|---|

Stability | experimental |

Maintainer | Bryan O'Sullivan <bos@mailrank.com> |

Storage and retrieval of data with automatic conflict resolution.

- class (Eq a, Show a) => Resolvable a where
- resolve :: a -> a -> a

- newtype ResolvableMonoid a = RM {
- unRM :: a

# Documentation

class (Eq a, Show a) => Resolvable a whereSource

A type that can automatically resolve a vector clock conflict between two or more versions of a value.

Instances must be symmetric in their behaviour, such that the following law is obeyed:

resolve a b == resolve b a

Otherwise, there are no restrictions on the behaviour of `resolve`

.
The result may be `a`

, `b`

, a value derived from `a`

and `b`

, or
something else.

If several conflicting siblings are found, `resolve`

will be
applied over all of them using a fold, to yield a single
"winner".

Resolvable a => Resolvable (Maybe a) | |

(Eq a, Show a, Monoid a) => Resolvable (ResolvableMonoid a) |

newtype ResolvableMonoid a Source

A newtype wrapper that uses the `mappend`

method of a type's
`Monoid`

instance to perform vector clock conflict resolution.

Typeable1 ResolvableMonoid | |

Eq a => Eq (ResolvableMonoid a) | |

Data a => Data (ResolvableMonoid a) | |

Ord a => Ord (ResolvableMonoid a) | |

Read a => Read (ResolvableMonoid a) | |

Show a => Show (ResolvableMonoid a) | |

ToJSON a => ToJSON (ResolvableMonoid a) | |

FromJSON a => FromJSON (ResolvableMonoid a) | |

Monoid a => Monoid (ResolvableMonoid a) | |

(Eq a, Show a, Monoid a) => Resolvable (ResolvableMonoid a) | |

IsContent a => IsContent (ResolvableMonoid a) |