witherable-0.1.1.1: Generalization of catMaybes

Safe HaskellNone
LanguageHaskell2010

Data.Witherable

Synopsis

Documentation

class Traversable t => Witherable t where Source

Like traverse, but you can remove elements instead of updating them. traverse f = wither (fmap Just . f) Minimal complete definition: wither or catMaybes.

Minimal complete definition

Nothing

Methods

wither :: Applicative f => (a -> f (Maybe b)) -> t a -> f (t b) Source

catMaybes :: Witherable t => t (Maybe a) -> t a Source

witherM :: Monad m => (a -> MaybeT m b) -> t a -> m (t b) Source

blightM :: (Monad m, Witherable t) => t a -> (a -> MaybeT m b) -> m (t b) Source

blightM is witherM with its arguments flipped.