hedis-pile 0.2.0 → 0.2.1
raw patch · 3 files changed
+7/−9 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Database.Redis.Pile: pile :: ByteString -> ByteString -> Maybe (ByteString, ByteString) -> IO ([(ByteString, ByteString)], Maybe Integer, Maybe [ByteString]) -> Redis (Maybe [(ByteString, ByteString)])
+ Database.Redis.Pile: pile :: ByteString -> ByteString -> Maybe (ByteString, ByteString) -> IO ([(ByteString, ByteString)], Maybe Integer, [ByteString]) -> Redis (Maybe [(ByteString, ByteString)])
Files
hedis-pile.cabal view
@@ -1,5 +1,5 @@ name: hedis-pile -version: 0.2.0 +version: 0.2.1 cabal-version: >= 1.8 build-type: Simple stability: Experimental
src/Database/Redis/Pile.hs view
@@ -63,7 +63,7 @@ -- ^ Optional expect field. -> IO ([(B.ByteString, B.ByteString)], Maybe Integer, - Maybe [B.ByteString]) + [B.ByteString]) -- ^ Computation that returns data and -- optional TTL and tags. All tags will be stored as @prefix:tag@. -> R.Redis (Maybe [(B.ByteString, B.ByteString)]) @@ -85,11 +85,9 @@ (r, ke, t) <- liftIO f void $ R.hmset withPrefix r setExpire ke - setTags t + RT.markTags [withPrefix] p t return $ Just r where setExpire Nothing = return () setExpire (Just ke) = void $ R.expire withPrefix ke - setTags Nothing = return () - setTags (Just ts) = RT.markTags [withPrefix] p ts
test/Database/Redis/Test/Pile.hs view
@@ -28,10 +28,10 @@ teardown $ runInRedis $ do r <- RP.pile allPrefix "two" Nothing $ - return (allData, Nothing, Nothing) + return (allData, Nothing, []) liftIO $ Just allData @=? r void $ RP.pile allPrefix "three" Nothing $ - return (allData, Just 15, Just ["one"]) + return (allData, Just 15, ["one"]) ex <- R.ttl $ allPrefix `B.append` ":three" liftIO $ Right 15 @=? ex @@ -41,10 +41,10 @@ teardown $ runInRedis $ do r <- RP.pile allPrefix "one" Nothing $ - return (allData, Nothing, Nothing) + return (allData, Nothing, []) liftIO $ Just allData @=? r r' <- RP.pile allPrefix "one" (Just ("etag", "etag")) $ - return (allData, Nothing, Nothing) + return (allData, Nothing, []) liftIO $ Nothing @=? r' runInRedis :: forall b. R.Redis b -> IO b