Copyright | (c) 2011 MailRank Inc. |
---|---|
License | Apache |
Maintainer | Mark Hibberd <mark@hibberd.id.au>, Nathan Hunter <nhunter@janrain.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Storage and retrieval of data with automatic conflict resolution.
Synopsis
- class Show a => Resolvable a where
- resolve :: a -> a -> a
- newtype ResolvableMonoid a = RM {
- unRM :: a
- data ResolutionFailure = RetriesExceeded
Documentation
class Show a => Resolvable a where Source #
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".
Instances
Resolvable a => Resolvable (Maybe a) Source # | |
(Show a, Monoid a) => Resolvable (ResolvableMonoid a) Source # | |
Defined in Network.Riak.Resolvable.Internal resolve :: ResolvableMonoid a -> ResolvableMonoid a -> ResolvableMonoid a Source # |
newtype ResolvableMonoid a Source #
A newtype wrapper that uses the mappend
method of a type's
Monoid
instance to perform vector clock conflict resolution.
Instances
data ResolutionFailure Source #
Automated conflict resolution failed.
RetriesExceeded | Too many attempts were made to resolve a conflict, with each attempt resulting in another conflict. The number of retries that the library will attempt is high
(64). This makes it extremely unlikely that this exception will
be thrown during normal application operation. Instead, this
exception is most likely to be thrown as a result of a bug in
your application code, for example if your |
Instances
Eq ResolutionFailure Source # | |
Defined in Network.Riak.Resolvable.Internal (==) :: ResolutionFailure -> ResolutionFailure -> Bool # (/=) :: ResolutionFailure -> ResolutionFailure -> Bool # | |
Show ResolutionFailure Source # | |
Defined in Network.Riak.Resolvable.Internal showsPrec :: Int -> ResolutionFailure -> ShowS # show :: ResolutionFailure -> String # showList :: [ResolutionFailure] -> ShowS # | |
Exception ResolutionFailure Source # | |