module Select: sig .. end
Takes the first few elements from a list.
Not sure if this will be used.
val take : int -> 'a list -> 'a list
Takes the first few elements from a list.
Not sure if this will be used.
val select : ('a -> 'a -> bool) -> int -> 'a list -> 'a list * 'a list
Given a list, selects the k smallest elements from that list,
using Hoare's selection algorithm.
Args:
f - a comparison function of type 'a -> 'a -> bool (this should
be reflexive and transitive)
k - number of things to select
list - a list of type 'a list
Returns:
a pair (selected, rest), where selected are the first k elements
and rest are the remaining elements.
val order_by_asc : ('a -> 'b) -> 'a -> 'a -> bool
These convert a function to an ordering relation.
val order_by_desc : ('a -> 'b) -> 'a -> 'a -> bool