min

func min(sl : Set+List, m : Map) -> sl
  return first(sort(sl, `<=')) when m = Undefined
  return first(sort(fmap(m, sl), `<='))

Returns the element of the given set or list which is minimal under the given mapping. Returns Undefined when applied to infinite sets. For example:
  min([1 2 3]) = 1
  min({1 2 3} [20 30 10]) = 3
  min(Number) = Undefined
See also: max.
Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.