let extremum comp array = assert (Array.length array > 0); Array.fold_left (fun accu elt -> if comp accu elt then accu else elt) array.(0) array