Skip to content

Commit e3042d5

Browse files
Rename foldBreakChunksK to foldBreak in Array module
1 parent 64a473f commit e3042d5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/src/Streamly/Internal/Data/Array.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module Streamly.Internal.Data.Array
7373
-- * Parsing Stream of Arrays
7474
, foldBreakChunks -- Uses Stream, bad perf on break
7575
, foldChunks
76-
, foldBreakChunksK -- XXX rename to foldBreak
76+
, foldBreak
7777
, parseBreakChunksK -- XXX uses Parser. parseBreak is better?
7878
, parserK
7979
, parseBreak
@@ -105,6 +105,7 @@ module Streamly.Internal.Data.Array
105105
, compactOnByteSuffix
106106
, splitOn
107107
, fold
108+
, foldBreakChunksK
108109
)
109110
where
110111

@@ -721,14 +722,14 @@ foldChunks f s = fmap fst (foldBreakChunks f s)
721722
--
722723
-- We can compare perf and remove this one or define it in terms of that.
723724
--
724-
foldBreakChunksK :: forall m a b. (MonadIO m, Unbox a) =>
725+
foldBreak, foldBreakChunksK :: forall m a b. (MonadIO m, Unbox a) =>
725726
Fold m a b -> StreamK m (Array a) -> m (b, StreamK m (Array a))
726727
{-
727728
foldBreakChunksK f s =
728729
fmap (first (fromRight undefined))
729730
$ StreamK.parseBreakChunks (ParserK.adaptC (Parser.fromFold f)) s
730731
-}
731-
foldBreakChunksK (Fold fstep initial _ final) stream = do
732+
foldBreak (Fold fstep initial _ final) stream = do
732733
res <- initial
733734
case res of
734735
Fold.Partial fs -> go fs stream
@@ -758,6 +759,8 @@ foldBreakChunksK (Fold fstep initial _ final) stream = do
758759
return $! (b, StreamK.cons arr st)
759760
Fold.Partial fs1 -> goArray fs1 st fp next
760761

762+
RENAME(foldBreakChunksK,foldBreak)
763+
761764
{-
762765
-- This can be generalized to any type provided it can be unfolded to a stream
763766
-- and it can be combined using a semigroup operation.

0 commit comments

Comments
 (0)