Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import qualified Network.Riak.Basic as R (connect, delete, foldKeys)
- import qualified Network.Riak.Types as R
- import qualified Network.Riak.Content as R (Content(..), Link, link)
- import qualified Network.Riak.Value.Monoid as R
- getMulti :: (Monoid c, R.IsContent c) => R.Connection -> R.Bucket -> [R.Key] -> IO [Maybe (c, R.VClock)]
- getMulti c b k = R.getMany c b k R.Default
- putMulti :: (Eq c, Monoid c, R.IsContent c) => R.Connection -> R.Bucket -> [R.Key] -> [c] -> IO [(c, R.VClock)]
- putMulti c b k v = do vc <- map (snd `fmap`) `liftM` getMulti c b k
- R.putMany c b (zip3 k vc v) R.Default R.Default
- fails with:
- slurp.hs:119:54:
- Ambiguous type variable `c' in the constraints:
- (Monoid c) arising from a use of `getMulti' at slurp.hs:119:54-61
- (R.IsContent c) arising from a use of `getMulti'
- at slurp.hs:119:54-61
- Probable fix: add a type signature that fixes these type variable(s)
- In the second argument of `liftM', namely `getMulti c b k'
- In a stmt of a 'do' expression:
- vc <- map (snd `fmap`) `liftM` getMulti c b k
- In the expression:
- do { vc <- map (snd `fmap`) `liftM` getMulti c b k;
- R.putMany c b (zip3 k vc v) R.Default R.Default }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement