extra-1.7.16: Extra functions I use.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Foldable.Extra

Synopsis

Documentation

notNull :: Foldable f => f a -> Bool Source #

Composition of not and null

sum' :: (Foldable f, Num a) => f a -> a Source #

A generalization of sum' to Foldable instances.

product' :: (Foldable f, Num a) => f a -> a Source #

A generalization of product' to Foldable instances.

sumOn' :: (Foldable f, Num b) => (a -> b) -> f a -> b Source #

A generalization of sumOn' to Foldable instances.

productOn' :: (Foldable f, Num b) => (a -> b) -> f a -> b Source #

A generalization of productOn' to Foldable instances.

anyM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool Source #

A generalization of anyM to Foldable instances. Retains the short-circuiting behaviour.

allM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool Source #

A generalization of allM to Foldable instances. Retains the short-circuiting behaviour.

orM :: (Foldable f, Monad m) => f (m Bool) -> m Bool Source #

A generalization of orM to Foldable instances. Retains the short-circuiting behaviour.

andM :: (Foldable f, Monad m) => f (m Bool) -> m Bool Source #

A generalization of andM to Foldable instances. Retains the short-circuiting behaviour.

findM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m (Maybe a) Source #

A generalization of findM to Foldable instances.

firstJustM :: (Foldable f, Monad m) => (a -> m (Maybe b)) -> f a -> m (Maybe b) Source #

A generalization of firstJustM to Foldable instances.