(* A counter is a pair of functions, which implement the operations [next] and [reset]. *) type counter = (unit -> int) * (unit -> unit) (* The function call [count init step] produces a new counter, whose initial value is [init], and whose step is [step]. *) val count: int -> int -> counter