Copyright | (c) 2016-2017 Red Hat Inc. |
---|---|

License | LGPL |

Maintainer | https://github.com/weldr |

Stability | alpha |

Portability | portable |

Safe Haskell | Safe |

Language | Haskell2010 |

Monad related utility functions

- concatForM :: (Monad m, Traversable t) => t a -> (a -> m [b]) -> m [b]
- concatMapM :: (Monad m, Traversable t) => (a -> m [b]) -> t a -> m [b]
- foldMaybeM :: Monad m => (b -> a -> m (Maybe b)) -> b -> [a] -> m b
- mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
- (>>?) :: Monad m => m (Maybe a) -> (a -> m b) -> m (Maybe b)

# Documentation

concatForM :: (Monad m, Traversable t) => t a -> (a -> m [b]) -> m [b] Source #

Like `concatMap`

, but with its arguments reversed (the list comes
first and the function comes second) and operates in a monad.

concatMapM :: (Monad m, Traversable t) => (a -> m [b]) -> t a -> m [b] Source #

Like `concatMap`

but operates in a monad.

foldMaybeM :: Monad m => (b -> a -> m (Maybe b)) -> b -> [a] -> m b Source #