riak-1.2.0.0: A Haskell client for the Riak decentralized data store
Copyright(c) 2011 MailRank Inc.
LicenseApache
MaintainerMark Hibberd <mark@hibberd.id.au>, Nathan Hunter <nhunter@janrain.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.Riak.Resolvable

Description

Storage and retrieval of data with automatic conflict resolution.

Synopsis

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".

Methods

resolve :: a -> a -> a Source #

Resolve a conflict between two values.

Instances

Instances details
Resolvable a => Resolvable (Maybe a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

Methods

resolve :: Maybe a -> Maybe a -> Maybe a Source #

(Show a, Monoid a) => Resolvable (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

newtype ResolvableMonoid a Source #

A newtype wrapper that uses the mappend method of a type's Monoid instance to perform vector clock conflict resolution.

Constructors

RM 

Fields

Instances

Instances details
Eq a => Eq (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

Data a => Data (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ResolvableMonoid a -> c (ResolvableMonoid a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ResolvableMonoid a) #

toConstr :: ResolvableMonoid a -> Constr #

dataTypeOf :: ResolvableMonoid a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ResolvableMonoid a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ResolvableMonoid a)) #

gmapT :: (forall b. Data b => b -> b) -> ResolvableMonoid a -> ResolvableMonoid a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ResolvableMonoid a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ResolvableMonoid a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ResolvableMonoid a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ResolvableMonoid a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ResolvableMonoid a -> m (ResolvableMonoid a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ResolvableMonoid a -> m (ResolvableMonoid a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ResolvableMonoid a -> m (ResolvableMonoid a) #

Ord a => Ord (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

Read a => Read (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

Show a => Show (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

Semigroup a => Semigroup (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

Monoid a => Monoid (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

ToJSON a => ToJSON (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

FromJSON a => FromJSON (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

(Show a, Monoid a) => Resolvable (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Resolvable.Internal

IsContent a => IsContent (ResolvableMonoid a) Source # 
Instance details

Defined in Network.Riak.Value

data ResolutionFailure Source #

Automated conflict resolution failed.

Constructors

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 resolve function is misbehaving.