@@ -272,6 +272,7 @@ import Data.Maybe (isJust, fromJust)
272import Fusion.Plugin.Types (Fuse(..))
272import Fusion.Plugin.Types (Fuse(..))
273import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
273import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
274import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
274import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
275+import Streamly.Internal.Data.Consumer.Type (Fold2(..))
276import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
277import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
@@ -570,16 +571,9 @@ mkFoldM_ step initial = mkFoldM step initial return
571------------------------------------------------------------------------------
572------------------------------------------------------------------------------
573−-- | Experimental type to provide a side input to the fold for generating the
574+-- This is similar to how we run an Unfold to generate a Stream. A Fold is like
574−-- initial state. For example, if we have to fold chunks of a stream and write
575+-- a Stream and a Fold2 is like an Unfold.
575−-- each chunk to a different file, then we can generate the file name using a
576−-- monadic action. This is a generalized version of 'Fold'.
580− -- | @Fold @ @ step @ @ inject @ @ extract@
581− forall s. Fold2 (s -> a -> m s) (c -> m s) (s -> m b)
583-- | Convert more general type 'Fold2' into a simpler type 'Fold'
577-- | Convert more general type 'Fold2' into a simpler type 'Fold'
585-- /Internal/
579-- /Internal/