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 elementx
ofxs
for whichf x y
is eitherLT
orEQ
for all othery
inxs
. The result is wrapped in a monadic context, with a failure ifxs
is empty.
- maximumBy
: ActionFail m => (a -> a -> Ordering) -> [a] -> m a
maximumBy f xs
returns the first elementx
ofxs
for whichf x y
is eitherGT
orEQ
for all othery
inxs
. The result is wrapped in a monadic context, with a failure ifxs
is empty.
- minimumOn
: (ActionFail m, Ord k) => (a -> k) -> [a] -> m a
minimumOn f xs
returns the first elementx
ofxs
for whichf x
is smaller than or equal to any otherf y
fory
inxs
. The result is wrapped in a monadic context, with a failure ifxs
is empty.
- maximumOn
: (ActionFail m, Ord k) => (a -> k) -> [a] -> m a
maximumOn f xs
returns the first elementx
ofxs
for whichf x
is greater than or equal to any otherf y
fory
inxs
. The result is wrapped in a monadic context, with a failure ifxs
is empty.