Module type Group.GROUP

module type GROUP = sig .. end
This module type encapsulates types and functions for working with groups of contests

type t 
The basic grouping unit of Tournabox. An ordered collection of contests
val make : unit -> t
Create a new group
val make_one : Group.contest -> t
Create a group containing one contest
val iteri : (int -> Group.contest -> unit) -> t -> unit
iteri f g runs f on each contest in g
val length : t -> int
Get the length of a group
val contains : (Group.contest -> bool) -> t -> bool
contains f g yields true if g contains a contest matching f
val first : t -> Group.contest option
Get the first contest of a group, if there is one.
val add : Group.contest -> t -> unit
Add a contest to a group.
val compare_length_then_first : t -> t -> int
This is for sorting groups. First, compare their lengths. Then look at the first player in each first contest. If they both won or both lost, compare the contestants. Otherwise compare the win/loss results.
val match_first : Group.contest -> t -> (Entry.slot -> 'a) -> bool
This is for determining whether a contest belongs in a group at all. It checks the first contestant of the contest against the first contestant of the first contest in the group. The function argument is applied to both contestants, and the results are tested with '='.
val extract_first_first : t -> (Entry.slot -> 'a) -> 'a
This is for extracting Group headers. For example, the header of a group in the `By Country' Grouping is the name of the country.

extract_first_first group f calls f on the first (slot) contestant of the first contest in group, and returns what f returns.

val sort : (Group.contest -> Group.contest -> int) -> t -> unit
Sort a group with a sorting function