Skip to content

Commit

Permalink
lacks STREAMING
Browse files Browse the repository at this point in the history
  • Loading branch information
ocramz committed Nov 24, 2020
1 parent 1e7735e commit b94bec0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions conduit/src/Data/Conduit/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b94bec0

Please sign in to comment.