[semidet]max_member(:Pred,
-Max, +List)True when Max is the largest member according to Pred,
which must be a 2-argument callable that behaves like (@=<
)/2.
Fails if List is empty. The following call is equivalent to max_member/2:
?- max_member(@=<, X, [6,1,8,4]).
X = 8.
- See also
- max_list/2 for the
maximum of a list of numbers.