module Network.Riak.Value.Resolvable
(
V.IsContent(..)
, Resolvable(..)
, ResolutionFailure(..)
, get
, getMany
, modify
, modify_
, put
, put_
, putMany
, putMany_
) where
import Network.Riak.Resolvable.Internal (ResolutionFailure(..), Resolvable(..))
import Network.Riak.Types.Internal hiding (MessageTag(..))
import qualified Network.Riak.Resolvable.Internal as R
import qualified Network.Riak.Value as V
get :: (Resolvable a, V.IsContent a) =>
Connection -> Maybe BucketType -> Bucket -> Key -> R -> IO (Maybe (a, VClock))
get :: Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> IO (Maybe (a, VClock))
get = Get a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> IO (Maybe (a, VClock))
forall a.
Resolvable a =>
Get a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> IO (Maybe (a, VClock))
R.get Get a
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> IO (Maybe ([c], VClock))
V.get
{-# INLINE get #-}
getMany :: (Resolvable a, V.IsContent a) => Connection
-> Maybe BucketType -> Bucket -> [Key] -> R
-> IO [Maybe (a, VClock)]
getMany :: Connection
-> Maybe BucketType
-> BucketType
-> [BucketType]
-> R
-> IO [Maybe (a, VClock)]
getMany = (Connection
-> Maybe BucketType
-> BucketType
-> [BucketType]
-> R
-> IO [Maybe ([a], VClock)])
-> Connection
-> Maybe BucketType
-> BucketType
-> [BucketType]
-> R
-> IO [Maybe (a, VClock)]
forall a.
Resolvable a =>
(Connection
-> Maybe BucketType
-> BucketType
-> [BucketType]
-> R
-> IO [Maybe ([a], VClock)])
-> Connection
-> Maybe BucketType
-> BucketType
-> [BucketType]
-> R
-> IO [Maybe (a, VClock)]
R.getMany Connection
-> Maybe BucketType
-> BucketType
-> [BucketType]
-> R
-> IO [Maybe ([a], VClock)]
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> [BucketType]
-> R
-> IO [Maybe ([c], VClock)]
V.getMany
{-# INLINE getMany #-}
modify :: (Resolvable a, V.IsContent a) =>
Connection -> Maybe BucketType -> Bucket -> Key -> R -> W -> DW
-> (Maybe a -> IO (a,b))
-> IO (a,b)
modify :: Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> R
-> R
-> (Maybe a -> IO (a, b))
-> IO (a, b)
modify = Get a
-> Put a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> R
-> R
-> (Maybe a -> IO (a, b))
-> IO (a, b)
forall (m :: * -> *) a b.
(MonadIO m, Resolvable a) =>
Get a
-> Put a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> R
-> R
-> (Maybe a -> m (a, b))
-> m (a, b)
R.modify Get a
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> IO (Maybe ([c], VClock))
V.get Put a
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> c
-> R
-> R
-> IO ([c], VClock)
V.put
{-# INLINE modify #-}
modify_ :: (Resolvable a, V.IsContent a) =>
Connection -> Maybe BucketType -> Bucket -> Key -> R -> W -> DW
-> (Maybe a -> IO a) -> IO a
modify_ :: Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> R
-> R
-> (Maybe a -> IO a)
-> IO a
modify_ = Get a
-> Put a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> R
-> R
-> (Maybe a -> IO a)
-> IO a
forall (m :: * -> *) a.
(MonadIO m, Resolvable a) =>
Get a
-> Put a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> R
-> R
-> (Maybe a -> m a)
-> m a
R.modify_ Get a
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> R
-> IO (Maybe ([c], VClock))
V.get Put a
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> c
-> R
-> R
-> IO ([c], VClock)
V.put
{-# INLINE modify_ #-}
put :: (Resolvable a, V.IsContent a) =>
Connection -> Maybe BucketType -> Bucket -> Key
-> Maybe VClock -> a -> W -> DW
-> IO (a, VClock)
put :: Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO (a, VClock)
put = Put a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO (a, VClock)
forall a.
Resolvable a =>
Put a
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO (a, VClock)
R.put Put a
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> c
-> R
-> R
-> IO ([c], VClock)
V.put
{-# INLINE put #-}
put_ :: (Resolvable a, V.IsContent a) =>
Connection -> Maybe BucketType -> Bucket -> Key
-> Maybe VClock -> a -> W -> DW
-> IO ()
put_ :: Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO ()
put_ = (Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO ([a], VClock))
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO ()
forall a.
Resolvable a =>
(Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO ([a], VClock))
-> Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO ()
R.put_ Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> a
-> R
-> R
-> IO ([a], VClock)
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> BucketType
-> Maybe VClock
-> c
-> R
-> R
-> IO ([c], VClock)
V.put
{-# INLINE put_ #-}
putMany :: (Resolvable a, V.IsContent a) =>
Connection -> Maybe BucketType -> Bucket -> [(Key, Maybe VClock, a)] -> W -> DW
-> IO [(a, VClock)]
putMany :: Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [(a, VClock)]
putMany = (Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [([a], VClock)])
-> Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [(a, VClock)]
forall a.
Resolvable a =>
(Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [([a], VClock)])
-> Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [(a, VClock)]
R.putMany Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [([a], VClock)]
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, c)]
-> R
-> R
-> IO [([c], VClock)]
V.putMany
{-# INLINE putMany #-}
putMany_ :: (Resolvable a, V.IsContent a) =>
Connection -> Maybe BucketType -> Bucket
-> [(Key, Maybe VClock, a)] -> W -> DW -> IO ()
putMany_ :: Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO ()
putMany_ = (Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [([a], VClock)])
-> Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO ()
forall a.
Resolvable a =>
(Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [([a], VClock)])
-> Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO ()
R.putMany_ Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, a)]
-> R
-> R
-> IO [([a], VClock)]
forall c.
IsContent c =>
Connection
-> Maybe BucketType
-> BucketType
-> [(BucketType, Maybe VClock, c)]
-> R
-> R
-> IO [([c], VClock)]
V.putMany
{-# INLINE putMany_ #-}