Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Some interesting examples of effectful folds
Synopsis
- effect :: Monad m => (a -> m b) -> EffectfulFold m a ()
- effectMonoid :: (Monoid w, Monad m) => (a -> m w) -> EffectfulFold m a w
Documentation
effect :: Monad m => (a -> m b) -> EffectfulFold m a () Source #
Performs an action for each input, discarding the result
effectMonoid :: (Monoid w, Monad m) => (a -> m w) -> EffectfulFold m a w Source #
Performs an action for each input, monoidally combining the results from all the actions.