(* This type represents a value (vv, of type 'a) and an associated count (nn, of type int).
*
* For instance, { vv = "ok" ; nn = 6 } means that the value "ok" has been counted 6 times.
*)
type 'a count =
{ vv: 'a ;
nn: int }
type 'a filter =
(* Equal x : filters counts where vv = x (we compare vv here) *)
| Equal of 'a
(* GT x : filters counts where nn > x (we compare nn here) *)
| GT of int
(* This part is used later. *)
type 'a tree =
(* This is a sort node. It contains a left subtree, a comparison value, and a right subtree. *)
| S of ('a tree) * int * ('a tree)
(* This is a leaf. It contains a count node. *)
| C of 'a count
(* This is an empty leaf. *)
| Z