Returns a min (resp max) element from the collection using the provided
function. In case of a tie, the first element encountered while traversing the
collection is returned. The implementation uses
fold so it has the same
None iff the collection is empty.
This function only needs implementation if
t exposed to be a polymorphic variant.
Despite what the type reads, this does *not* produce a function after reading;
instead it takes the constructor tag (int) before reading and reads the rest of the