Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import qualified Network.Riak.Basic as R (connect, delete, foldKeys)
  2. import qualified Network.Riak.Types as R
  3. import qualified Network.Riak.Content as R (Content(..), Link, link)
  4. import qualified Network.Riak.Value.Monoid as R
  5.  
  6. getMulti :: (Monoid c, R.IsContent c) => R.Connection -> R.Bucket -> [R.Key] -> IO [Maybe (c, R.VClock)]
  7. getMulti c b k = R.getMany c b k R.Default
  8.  
  9. putMulti :: (Eq c, Monoid c, R.IsContent c) => R.Connection -> R.Bucket -> [R.Key] -> [c] -> IO [(c, R.VClock)]
  10. putMulti c b k v = do vc <- map (snd `fmap`) `liftM` getMulti c b k
  11.                       R.putMany c b (zip3 k vc v) R.Default R.Default
  12.  
  13.  
  14. fails with:
  15.  
  16.  
  17. slurp.hs:119:54:
  18.     Ambiguous type variable `c' in the constraints:
  19.      (Monoid c) arising from a use of `getMulti' at slurp.hs:119:54-61
  20.       (R.IsContent c) arising from a use of `getMulti'
  21.                      at slurp.hs:119:54-61
  22.    Probable fix: add a type signature that fixes these type variable(s)
  23.    In the second argument of `liftM', namely `getMulti c b k'
  24.    In a stmt of a 'do' expression:
  25.        vc <- map (snd `fmap`) `liftM` getMulti c b k
  26.    In the expression:
  27.      do { vc <- map (snd `fmap`) `liftM` getMulti c b k;
  28.           R.putMany c b (zip3 k vc v) R.Default R.Default }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement