Returns an element of the non-empty list l that minimizes f. If x, y are
such that f x = f y, it returns whichever comes first in the list.
The correctness of this function assumes β to be linearly pre-ordered.
The property that List.minOn is the first minimizer in the list is guaranteed by the lemma
List.getElem_minIdxOn.
Instances For
Returns an element of the non-empty list l that maximizes f. If x, y are
such that f x = f y, it returns whichever comes first in the list.
The correctness of this function assumes β to be linearly pre-ordered.
The property that List.maxOn is the first maximizer in the list is guaranteed by the lemma
List.getElem_maxIdxOn.
Instances For
Returns an element of l that minimizes f. If x, y are such that
f x = f y, it returns whichever comes first in the list. Returns none if the list is
empty.
The correctness of this function assumes β to be linearly pre-ordered.
The property that List.minOn? is the first minimizer in the list is guaranteed by the lemma
List.getElem_get_minIdxOn?
Instances For
Returns an element of l that maximizes f. If x, y are such that
f x = f y, it returns whichever comes first in the list. Returns none if the list is
empty.
The correctness of this function assumes β to be linearly pre-ordered.
The property that List.maxOn? is the first minimizer in the list is guaranteed by the lemma
List.getElem_get_maxIdxOn?.
Instances For
List.minOn? returns none when applied to an empty list.