From 5bb77518a83a2519152a5e3929b59b71f27a185c Mon Sep 17 00:00:00 2001 From: Scott Fleischman Date: Wed, 29 May 2019 17:18:00 -0700 Subject: [PATCH] Revert "Remove use of conduit Producer and Consumer." This reverts commit 5f04dc6a237d0191beed76a8951f437750fd1b51. Leave the use of Producer and Consumer for now until we drop support for conduit-1.2.*. conduit-1.3 introduces ConduitT and deprecates the use of type synonyms. However, ConduitT is not present in conduit-1.2. --- Database/MongoDB/GridFS.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database/MongoDB/GridFS.hs b/Database/MongoDB/GridFS.hs index 631a8ef..aeb6ea2 100644 --- a/Database/MongoDB/GridFS.hs +++ b/Database/MongoDB/GridFS.hs @@ -110,7 +110,7 @@ putChunk :: (Monad m, MonadIO m) => Bucket -> ObjectId -> Int -> L.ByteString -> putChunk bucket files_id i chunk = do insert_ (chunks bucket) ["files_id" =: files_id, "n" =: i, "data" =: Binary (L.toStrict chunk)] -sourceFile :: (Monad m, MonadIO m) => File -> ConduitT i S.ByteString (Action m) () +sourceFile :: (Monad m, MonadIO m) => File -> Producer (Action m) S.ByteString -- ^ A producer for the contents of a file sourceFile file = yieldChunk 0 where yieldChunk i = do @@ -179,7 +179,7 @@ writeChunks (FileWriter chunkSize bucket files_id i size acc md5context md5acc) putChunk bucket files_id i newChunk writeChunks (FileWriter chunkSize bucket files_id (i+1) size' acc' md5context' md5acc') L.empty -sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> ConduitT S.ByteString o (Action m) File +sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> Consumer S.ByteString (Action m) File -- ^ A consumer that creates a file in the bucket and puts all consumed data in it sinkFile bucket filename = do files_id <- liftIO $ genObjectId