on master help sign in
hide lchunksOf and lsessionsOf
d372260Harendra Kumar
src/Streamly/Fold.hs+8−8
@@ -226,8 +226,8 @@ module Streamly.Fold
226 , chunksOf
226 , chunksOf
227 , sessionsOf
227 , sessionsOf
228
228
229− , lchunksOf
229+ -- , lchunksOf
230− , lsessionsOf
230+ -- , lsessionsOf
231
231
232 -- *** By Elements
232 -- *** By Elements
233 , splitBy
233 , splitBy
@@ -2292,9 +2292,9 @@ lchunksInRange low high (Fold step1 initial1 extract1)
2292--
2292--
2293-- @
2293-- @
2294--
2294--
2295−{-# INLINE lchunksOf #-}
2295+{-# INLINE _lchunksOf #-}
2296−lchunksOf :: Monad m => Int -> Fold m a b -> Fold m b c -> Fold m a c
2296+_lchunksOf :: Monad m => Int -> Fold m a b -> Fold m b c -> Fold m a c
2297−lchunksOf n (Fold step1 initial1 extract1) (Fold step2 initial2 extract2) =
2297+_lchunksOf n (Fold step1 initial1 extract1) (Fold step2 initial2 extract2) =
2298 Fold step' initial' extract'
2298 Fold step' initial' extract'
2299
2299
2300 where
2300 where
@@ -2326,9 +2326,9 @@ lchunksOf n (Fold step1 initial1 extract1) (Fold step2 initial2 extract2) =
2326-- -----Fold m a b----|-Fold n a c-|-Fold n a c-|-...-|----Fold m a c
2326-- -----Fold m a b----|-Fold n a c-|-Fold n a c-|-...-|----Fold m a c
2327--
2327--
2328-- @
2328-- @
2329−{-# INLINE lsessionsOf #-}
2329+{-# INLINE _lsessionsOf #-}
2330−lsessionsOf :: MonadAsync m => Double -> Fold m a b -> Fold m b c -> Fold m a c
2330+_lsessionsOf :: MonadAsync m => Double -> Fold m a b -> Fold m b c -> Fold m a c
2331−lsessionsOf n (Fold step1 initial1 extract1) (Fold step2 initial2 extract2) =
2331+_lsessionsOf n (Fold step1 initial1 extract1) (Fold step2 initial2 extract2) =
2332 Fold step' initial' extract'
2332 Fold step' initial' extract'
2333
2333
2334 where
2334 where
src/Streamly/Mem/Array.hs+3−1
@@ -150,7 +150,7 @@ where
150
150
151import Control.Monad (when)
151import Control.Monad (when)
152import Control.Monad.IO.Class (MonadIO(..))
152import Control.Monad.IO.Class (MonadIO(..))
153−import Data.Functor.Identity (Identity)
153+-- import Data.Functor.Identity (Identity)
154import Data.Word (Word8)
154import Data.Word (Word8)
155import Foreign.ForeignPtr (withForeignPtr)
155import Foreign.ForeignPtr (withForeignPtr)
156import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
156import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
@@ -402,11 +402,13 @@ toArraysInRange :: (IsStream t, MonadIO m, Storable a)
402toArraysInRange low high (Fold step initial extract) =
402toArraysInRange low high (Fold step initial extract) =
403-}
403-}
404
404
405+{-
405-- | Fold the input to a pure buffered stream (List) of arrays.
406-- | Fold the input to a pure buffered stream (List) of arrays.
406{-# INLINE _toArraysOf #-}
407{-# INLINE _toArraysOf #-}
407_toArraysOf :: (MonadIO m, Storable a)
408_toArraysOf :: (MonadIO m, Storable a)
408 => Int -> Fold m a (SerialT Identity (Array a))
409 => Int -> Fold m a (SerialT Identity (Array a))
409_toArraysOf n = FL.lchunksOf n (A.toArrayN n) FL.toStream
410_toArraysOf n = FL.lchunksOf n (A.toArrayN n) FL.toStream
411+-}
410
412
411-- XXX The realloc based implementation needs to make one extra copy if we use
413-- XXX The realloc based implementation needs to make one extra copy if we use
412-- shrinkToFit. On the other hand, the stream of arrays implementation may
414-- shrinkToFit. On the other hand, the stream of arrays implementation may