safe-0.3.3: Library for safe (pattern match free) functions

Safe HaskellSafe-Infered

Safe.Foldable

Description

Equivalent versions to the Safe module, but generalised to work over any Foldable type.

Synopsis

Documentation

foldl1Note :: Foldable t => String -> (a -> a -> a) -> t a -> a

 Same as Data.Foldable.foldl1

foldl1Def :: Foldable t => a -> (a -> a -> a) -> t a -> a

foldl1May :: Foldable t => (a -> a -> a) -> t a -> Maybe a

foldl1Safe :: (Monoid m, Foldable t) => (m -> m -> m) -> t m -> m

Default value is the mempty from a monoid

foldr1Note :: Foldable t => String -> (a -> a -> a) -> t a -> a

 Same as Data.Foldable.foldr1

foldr1Def :: Foldable t => a -> (a -> a -> a) -> t a -> a

foldr1May :: Foldable t => (a -> a -> a) -> t a -> Maybe a

foldr1Safe :: (Monoid m, Foldable t) => (m -> m -> m) -> t m -> m

Default value is the mempty from a monoid

findJust :: Foldable t => (a -> Bool) -> t a -> a

 Same as Data.Foldable.find

findJustDef :: Foldable t => a -> (a -> Bool) -> t a -> a

findJustNote :: Foldable t => String -> (a -> Bool) -> t a -> a

findJustSafe :: (Monoid m, Foldable t) => (m -> Bool) -> t m -> m

Default value is the mempty from a monoid