gambler-0.4.1.0: Composable, streaming, and efficient left folds
Safe HaskellSafe-Inferred
LanguageGHC2021

Fold.Effectful.Utilities

Synopsis

Documentation

hoist :: (forall x. m x -> n x) -> EffectfulFold m a b -> EffectfulFold n a b Source #

Shift an effectful fold from one monad to another with a morphism such as lift or liftIO

duplicate :: Applicative m => EffectfulFold m a b -> EffectfulFold m a (EffectfulFold m a b) Source #

Allows to continue feeding an effectful fold even after passing it to a function that closes it

premap :: Monad m => (a -> m b) -> EffectfulFold m b r -> EffectfulFold m a r Source #

Apply a function to each input

prefilter :: Monad m => (a -> m Bool) -> EffectfulFold m a r -> EffectfulFold m a r Source #

Consider only inputs that match an effectful predicate

drop :: Monad m => Natural -> EffectfulFold m a b -> EffectfulFold m a b Source #

Ignore the first n inputs