|
Data.List.Extras.ArgMax | Portability | portable | Stability | experimental | Maintainer | wren@community.haskell.org |
|
|
|
|
|
Description |
This module provides variants of the maximum and minimum
functions which return the element for which some function is
maximized or minimized.
|
|
Synopsis |
|
|
|
|
Maximum variations
|
|
|
Returns the element of the list which maximizes the function,
or Nothing if the list was empty.
|
|
argmax' :: Ord b => (a -> b) -> [a] -> a | Source |
|
Direct version of argmax which doesn't catch the empty list
error.
|
|
Minimum variations
|
|
|
Returns the element of the list which minimizes the function,
or Nothing if the list was empty.
|
|
argmin' :: Ord b => (a -> b) -> [a] -> a | Source |
|
Direct version of argmin which doesn't catch the empty list
error.
|
|
Generic versions
|
|
|
Returns the element of the list which maximizes a function
according to a user-defined ordering, or Nothing if the list
was empty.
|
|
|
Direct version of argmaxBy which doesn't catch the empty
list error.
|
|
Produced by Haddock version 2.3.0 |