@@ -164,6 +164,7 @@ module Streamly.Internal.Data.Stream.IsStream.Transform
164 -- Move these to Streamly.Data.Either.Stream?
164 -- Move these to Streamly.Data.Either.Stream?
168 -- * Concurrent Evaluation
169 -- * Concurrent Evaluation
169 -- ** Concurrent Pipelines
170 -- ** Concurrent Pipelines
@@ -1509,6 +1510,15 @@ lefts = fmap (fromLeft undefined) . filter isLeft
1509rights :: (IsStream t, Monad m, Functor (t m)) => t m (Either a b) -> t m b
1510rights :: (IsStream t, Monad m, Functor (t m)) => t m (Either a b) -> t m b
1510rights = fmap (fromRight undefined) . filter isRight
1511rights = fmap (fromRight undefined) . filter isRight
1513+-- | Remove the either wrapper and flatten both lefts and as well as rights in
1514+-- the output stream.
1519+both :: Functor (t m) => t m (Either a a) -> t m a
1520+both = fmap (either id id)
1512------------------------------------------------------------------------------
1522------------------------------------------------------------------------------
1513-- Concurrent Application
1523-- Concurrent Application
1514------------------------------------------------------------------------------
1524------------------------------------------------------------------------------