@@ -111,7 +111,7 @@ import Prelude hiding (read)
112import Streamly.Internal.BaseCompat
112import Streamly.Internal.BaseCompat
113import Streamly.Internal.Data.Fold (Fold)
113import Streamly.Internal.Data.Fold (Fold)
114−import Streamly.Internal.Data.Fold.Type (Fold2(..))
114+import Streamly.Internal.Data.Consumer.Type (Consumer(..))
115import Streamly.Internal.Data.Unfold.Type (Unfold(..))
115import Streamly.Internal.Data.Unfold.Type (Unfold(..))
116import Streamly.Internal.Data.Array.Foreign.Type
116import Streamly.Internal.Data.Array.Foreign.Type
117 (Array(..), writeNUnsafe, unsafeFreezeWithShrink)
117 (Array(..), writeNUnsafe, unsafeFreezeWithShrink)
@@ -457,9 +457,9 @@ writeChunks :: (MonadIO m, Storable a) => Handle -> Fold m (Array a) ()
457writeChunks h = FL.drainBy (putChunk h)
457writeChunks h = FL.drainBy (putChunk h)
459{-# INLINE writeChunks2 #-}
459{-# INLINE writeChunks2 #-}
460−writeChunks2 :: (MonadIO m, Storable a) => Fold2 m Handle (Array a) ()
460+writeChunks2 :: (MonadIO m, Storable a) => Consumer m Handle (Array a) ()
461writeChunks2 =
461writeChunks2 =
462− Fold2 (\h arr -> liftIO $ putChunk h arr >> return h)
462+ Consumer (\h arr -> liftIO $ putChunk h arr >> return h)
464 (\_ -> return ())
464 (\_ -> return ())
@@ -499,7 +499,7 @@ writeWithBufferOf :: MonadIO m => Int -> Handle -> Fold m Word8 ()
499writeWithBufferOf n h = FL.chunksOf n (writeNUnsafe n) (writeChunks h)
499writeWithBufferOf n h = FL.chunksOf n (writeNUnsafe n) (writeChunks h)
501{-# INLINE writeWithBufferOf2 #-}
501{-# INLINE writeWithBufferOf2 #-}
502−writeWithBufferOf2 :: MonadIO m => Int -> Fold2 m Handle Word8 ()
502+writeWithBufferOf2 :: MonadIO m => Int -> Consumer m Handle Word8 ()
503writeWithBufferOf2 n = FL.chunksOf2 n (writeNUnsafe n) writeChunks2
503writeWithBufferOf2 n = FL.chunksOf2 n (writeNUnsafe n) writeChunks2
505-- | Write a byte stream to a file handle. Accumulates the input in chunks of
505-- | Write a byte stream to a file handle. Accumulates the input in chunks of
@@ -514,7 +514,7 @@ write :: MonadIO m => Handle -> Fold m Word8 ()
514write = writeWithBufferOf defaultChunkSize
514write = writeWithBufferOf defaultChunkSize
516{-# INLINE write2 #-}
516{-# INLINE write2 #-}
517−write2 :: MonadIO m => Fold2 m Handle Word8 ()
517+write2 :: MonadIO m => Consumer m Handle Word8 ()
518write2 = writeWithBufferOf2 defaultChunkSize
518write2 = writeWithBufferOf2 defaultChunkSize