@@ -303,6 +303,9 @@ instance Functor (Step s) where
303-- 'Step'). At any point the fold driver can extract the result from the
303-- 'Step'). At any point the fold driver can extract the result from the
304-- intermediate state using the @extract@ function.
304-- intermediate state using the @extract@ function.
306+-- NOTE: If you think you need the constructor of this type please consider
307+-- using the smart constructors in "Streamly.Internal.Data.Fold' instead.
306-- @since 0.7.0
309-- @since 0.7.0
308data Fold m a b =
311data Fold m a b =
@@ -316,6 +319,9 @@ data Fold m a b =
316-- | Make an accumulating (non-terminating) fold using a pure step function, a
319-- | Make an accumulating (non-terminating) fold using a pure step function, a
317-- pure initial state and a pure state extraction function.
320-- pure initial state and a pure state extraction function.
322+-- If your 'Fold' returns only 'Partial' (i.e. never returns a 'Done') then you
323+-- can use @mkAccum*@ constructors.
319-- /Internal/
325-- /Internal/
321{-# INLINE mkAccum #-}
327{-# INLINE mkAccum #-}
@@ -329,6 +335,10 @@ mkAccum step initial extract =
329-- | Similar to 'mkAccum' but the final state extracted is identical to the
335-- | Similar to 'mkAccum' but the final state extracted is identical to the
330-- intermediate state.
336-- intermediate state.
339+-- mkAccum_ step initial = mkAccum step initial id
332-- /Internal/
342-- /Internal/
334{-# INLINE mkAccum_ #-}
344{-# INLINE mkAccum_ #-}
@@ -348,6 +358,10 @@ mkAccumM step initial =
348-- | Similar to 'mkAccumM' but the final state extracted is identical to the
358-- | Similar to 'mkAccumM' but the final state extracted is identical to the
349-- intermediate state.
359-- intermediate state.
362+-- mkAccumM_ step initial = mkAccumM step initial return
351-- /Internal/
365-- /Internal/
353{-# INLINE mkAccumM_ #-}
367{-# INLINE mkAccumM_ #-}
@@ -367,6 +381,10 @@ mkFold step initial extract =
367-- | Similar to 'mkFold' but the final state extracted is identical to the
381-- | Similar to 'mkFold' but the final state extracted is identical to the
368-- intermediate state.
382-- intermediate state.
385+-- mkFold_ step initial = mkFold step initial id
370-- /Internal/
388-- /Internal/
372{-# INLINE mkFold_ #-}
390{-# INLINE mkFold_ #-}
@@ -389,6 +407,10 @@ mkFoldM = Fold
389-- | Similar to 'mkFoldM' but the final state extracted is identical to the
407-- | Similar to 'mkFoldM' but the final state extracted is identical to the
390-- intermediate state.
408-- intermediate state.
411+-- mkFoldM_ step initial = mkFoldM step initial return
392-- /Internal/
414-- /Internal/
394{-# INLINE mkFoldM_ #-}
416{-# INLINE mkFoldM_ #-}