wiki:Functions/Min

min, minimum

of arity 2

min x y  =  case (x < y) of
               True  -> x
               False -> y
minimum []  =  errorEmptyList "minimum"
minimum xs  =  foldl1 min xs

min([H|T]) -> min(T, H).

min([H|T], Min) when H < Min -> min(T, H);
min([_|T], Min)              -> min(T, Min);
min([],    Min)              -> Min.
Last modified 3 years ago Last modified on Nov 3, 2016, 12:53:25 PM
Note: See TracWiki for help on using the wiki.