Skip to content

Commit 5bb7751

Browse files
Revert "Remove use of conduit Producer and Consumer."
This reverts commit 5f04dc6. 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.
1 parent 74a4041 commit 5bb7751

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Database/MongoDB/GridFS.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ putChunk :: (Monad m, MonadIO m) => Bucket -> ObjectId -> Int -> L.ByteString ->
110110
putChunk bucket files_id i chunk = do
111111
insert_ (chunks bucket) ["files_id" =: files_id, "n" =: i, "data" =: Binary (L.toStrict chunk)]
112112

113-
sourceFile :: (Monad m, MonadIO m) => File -> ConduitT i S.ByteString (Action m) ()
113+
sourceFile :: (Monad m, MonadIO m) => File -> Producer (Action m) S.ByteString
114114
-- ^ A producer for the contents of a file
115115
sourceFile file = yieldChunk 0 where
116116
yieldChunk i = do
@@ -179,7 +179,7 @@ writeChunks (FileWriter chunkSize bucket files_id i size acc md5context md5acc)
179179
putChunk bucket files_id i newChunk
180180
writeChunks (FileWriter chunkSize bucket files_id (i+1) size' acc' md5context' md5acc') L.empty
181181

182-
sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> ConduitT S.ByteString o (Action m) File
182+
sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> Consumer S.ByteString (Action m) File
183183
-- ^ A consumer that creates a file in the bucket and puts all consumed data in it
184184
sinkFile bucket filename = do
185185
files_id <- liftIO $ genObjectId

0 commit comments

Comments
 (0)