safe-0.3.8: Library of safe (exception free) functions

Safe HaskellSafe-Inferred

Safe.Foldable

Contents

Description

Foldable functions, with wrappers like the Safe module.

Synopsis

New functions

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

 findJust op = fromJust . find op

Safe wrappers

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

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

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

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

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

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

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

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

minimumMay :: (Foldable t, Ord a) => t a -> Maybe aSource

minimumDef :: (Foldable t, Ord a) => a -> t a -> aSource

minimumNote :: (Foldable t, Ord a) => String -> t a -> aSource

maximumMay :: (Foldable t, Ord a) => t a -> Maybe aSource

maximumDef :: (Foldable t, Ord a) => a -> t a -> aSource

maximumNote :: (Foldable t, Ord a) => String -> t a -> aSource

minimumByMay :: Foldable t => (a -> a -> Ordering) -> t a -> Maybe aSource

minimumByDef :: Foldable t => a -> (a -> a -> Ordering) -> t a -> aSource

minimumByNote :: Foldable t => String -> (a -> a -> Ordering) -> t a -> aSource

maximumByMay :: Foldable t => (a -> a -> Ordering) -> t a -> Maybe aSource

maximumByDef :: Foldable t => a -> (a -> a -> Ordering) -> t a -> aSource

maximumByNote :: Foldable t => String -> (a -> a -> Ordering) -> t a -> aSource

Deprecated

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

Deprecated: Use foldl f mempty instead.

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

Deprecated: Use foldr f mempty instead.

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

Deprecated: Use findJustDef mempty instead.