planet-mitchell-0.1.0: Planet Mitchell

Foldable.Partial

Contents

Synopsis

# Foldable

findJust :: (Partial, Foldable t) => (a -> Bool) -> t a -> a #

findJust op = fromJust . find op

foldr1 :: Foldable t => (a -> a -> a) -> t a -> a #

A variant of foldr that has no base case, and thus may only be applied to non-empty structures.

foldr1 f = foldr1 f . toList

maximum :: (Foldable t, Ord a) => t a -> a #

The largest element of a non-empty structure.

maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

The largest element of a non-empty structure with respect to the given comparison function.

minimum :: (Foldable t, Ord a) => t a -> a #

The least element of a non-empty structure.

minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

The least element of a non-empty structure with respect to the given comparison function.

# Bifoldable

bifoldl1 :: Bifoldable t => (a -> a -> a) -> t a a -> a #

A variant of bifoldl that has no base case, and thus may only be applied to non-empty structures.

Since: base-4.10.0.0

bifoldr1 :: Bifoldable t => (a -> a -> a) -> t a a -> a #

A variant of bifoldr that has no base case, and thus may only be applied to non-empty structures.

Since: base-4.10.0.0

bimaximum :: (Bifoldable t, Ord a) => t a a -> a #

The largest element of a non-empty structure.

Since: base-4.10.0.0

bimaximumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a #

The largest element of a non-empty structure with respect to the given comparison function.

Since: base-4.10.0.0

biminimum :: (Bifoldable t, Ord a) => t a a -> a #

The least element of a non-empty structure.

Since: base-4.10.0.0

biminimumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a #

The least element of a non-empty structure with respect to the given comparison function.

Since: base-4.10.0.0