folds-common-0.1.0.0: A playground of common folds for folds

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Fold.Common.M

Synopsis

Documentation

any :: (a -> Bool) -> M a Bool Source

Check that if predicate holds for any inputs to the fold.

all :: (a -> Bool) -> M a Bool Source

Check that if predicate holds for all inputs to the fold.

and :: M Bool Bool Source

Check whether all elements are True

or :: M Bool Bool Source

Check whether any elements are True

find :: (a -> Bool) -> M a (Maybe a) Source

Find the first element for which a predicate holds.

indexOf :: Enum e => (a -> Bool) -> M a (Maybe e) Source

Find the first index for which a predicate holds.

head :: M a (Maybe a) Source

Grab the first inputted element

strictify :: M a b -> L' a b Source

Occasionally we want to use a short-circuiting fold with other, nonlazy folds. This function drops laziness on the floor for a 'L\'' fold.