From b94bec006f2fb3d3c6ee9f809da86671e75beb7a Mon Sep 17 00:00:00 2001 From: ocramz Date: Tue, 24 Nov 2020 16:11:20 +0100 Subject: [PATCH] lacks STREAMING --- conduit/src/Data/Conduit/Combinators.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/conduit/src/Data/Conduit/Combinators.hs b/conduit/src/Data/Conduit/Combinators.hs index 2323a01e5..1dbf79277 100644 --- a/conduit/src/Data/Conduit/Combinators.hs +++ b/conduit/src/Data/Conduit/Combinators.hs @@ -1762,14 +1762,13 @@ STREAMING(mapAccumWhile, mapAccumWhileC, mapAccumWhileS, f s) -- Subject to fusion -- -- @since 1.3.4 -foldWhile, foldWhileC :: Monad m => (a -> s -> Either e s) -> s -> ConduitT a o m (Either e s) -foldWhileC f = loop +foldWhile :: Monad m => (a -> s -> Either e s) -> s -> ConduitT a o m (Either e s) +foldWhile f = loop where - loop !s = await >>= maybe (pure $ Right s) go + loop !s = await >>= maybe (return $ Right s) go where - go a = either (pure . Left $!) loop $ f a s -{-# INLINE foldWhileC #-} -STREAMING(foldWhile, foldWhileC, foldWhileS, f s) + go a = either (return . Left $!) loop $ f a s +{-# INLINE foldWhile #-} -- | 'concatMap' with an accumulator.