on master help sign in
Rename foldD to foldBreakD
c0f3151Harendra Kumar
src/Streamly/Internal/Data/Array/Stream/Foreign.hs+4−4
@@ -321,10 +321,10 @@ splitOnSuffix byte s =
321-- XXX This should be written using CPS (as foldK) if we want it to scale wrt
321-- XXX This should be written using CPS (as foldK) if we want it to scale wrt
322-- to the number of times it can be called on the same stream.
322-- to the number of times it can be called on the same stream.
323--
323--
324−{-# INLINE_NORMAL foldD #-}
324+{-# INLINE_NORMAL foldBreakD #-}
325−foldD :: forall m a b. (MonadIO m, Storable a) =>
325+foldBreakD :: forall m a b. (MonadIO m, Storable a) =>
326 Fold m a b -> D.Stream m (Array a) -> m (b, D.Stream m (Array a))
326 Fold m a b -> D.Stream m (Array a) -> m (b, D.Stream m (Array a))
327−foldD (Fold fstep initial extract) stream@(D.Stream step state) = do
327+foldBreakD (Fold fstep initial extract) stream@(D.Stream step state) = do
328 res <- initial
328 res <- initial
329 case res of
329 case res of
330 FL.Partial fs -> go SPEC state fs
330 FL.Partial fs -> go SPEC state fs
@@ -371,7 +371,7 @@ foldBreak ::
371 => FL.Fold m a b
371 => FL.Fold m a b
372 -> SerialT m (A.Array a)
372 -> SerialT m (A.Array a)
373 -> m (b, SerialT m (A.Array a))
373 -> m (b, SerialT m (A.Array a))
374−foldBreak f s = fmap fromStreamD <$> foldD f (toStreamD s)
374+foldBreak f s = fmap fromStreamD <$> foldBreakD f (toStreamD s)
375-- If fold performs better than runArrayFoldBreak we can rewrite runArrayFoldBreak to
375-- If fold performs better than runArrayFoldBreak we can rewrite runArrayFoldBreak to
376-- fold.
376-- fold.
377-- fold f = runArrayFoldBreak (ArrayFold.fromFold f)
377-- fold f = runArrayFoldBreak (ArrayFold.fromFold f)