@@ -186,6 +186,7 @@ module Streamly.Internal.Data.Fold.Types
186 , simplify
186 , simplify
188 -- * Basic Folds
188 -- * Basic Folds
191 -- * Generators
192 -- * Generators
@@ -439,6 +440,16 @@ simplify (Fold2 step inject extract) c =
439-- Basic Folds
440-- Basic Folds
440------------------------------------------------------------------------------
441------------------------------------------------------------------------------
443+-- | A fold that drains all its input, running the effects and discarding the
446+-- > drain = drainBy (const (return ()))
449+{-# INLINABLE drain #-}
450+drain :: Monad m => Fold m a ()
451+drain = mkAccum_ (\_ _ -> ()) ()
442-- | Folds the input stream to a list.
453-- | Folds the input stream to a list.
444-- /Warning!/ working on large lists accumulated as buffers in memory could be
455-- /Warning!/ working on large lists accumulated as buffers in memory could be