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

Safe Haskell | Safe-Inferred

Safe.Foldable

Description

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

Synopsis

- foldl1Note :: Foldable t => String -> (a -> a -> a) -> t a -> a
- 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
- foldr1Note :: Foldable t => String -> (a -> a -> a) -> t a -> a
- 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
- findJust :: Foldable t => (a -> Bool) -> t a -> a
- 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

# Documentation

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

     Same as Data.Foldable.foldl1

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

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

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

Default value is the mempty from a monoid

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

     Same as Data.Foldable.foldr1

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

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

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

Default value is the mempty from a monoid

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

     Same as Data.Foldable.find

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

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

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

Default value is the mempty from a monoid