Module DA.List.Total

Functions

head
: ActionFail m => [a] -> m a
tail
: ActionFail m => [a] -> m [a]
last
: ActionFail m => [a] -> m a
init
: ActionFail m => [a] -> m [a]
(!!)
: ActionFail m => [a] -> Int -> m a
foldl1
: ActionFail m => (a -> a -> a) -> [a] -> m a
foldr1
: ActionFail m => (a -> a -> a) -> [a] -> m a
foldBalanced1
: ActionFail m => (a -> a -> a) -> [a] -> m a
minimumBy

: ActionFail m => (a -> a -> Ordering) -> [a] -> m a

minimumBy f xs returns the first element x of xs for which f x y is either LT or EQ for all other y in xs. The result is wrapped in a monadic context, with a failure if xs is empty.

maximumBy

: ActionFail m => (a -> a -> Ordering) -> [a] -> m a

maximumBy f xs returns the first element x of xs for which f x y is either GT or EQ for all other y in xs. The result is wrapped in a monadic context, with a failure if xs is empty.

minimumOn

: (ActionFail m, Ord k) => (a -> k) -> [a] -> m a

minimumOn f xs returns the first element x of xs for which f x is smaller than or equal to any other f y for y in xs. The result is wrapped in a monadic context, with a failure if xs is empty.

maximumOn

: (ActionFail m, Ord k) => (a -> k) -> [a] -> m a

maximumOn f xs returns the first element x of xs for which f x is greater than or equal to any other f y for y in xs. The result is wrapped in a monadic context, with a failure if xs is empty.