module Counter:int countersig..end
a counter for non-negative numbers.
type counter
exception OVERFLOW
val create : unit -> counterval create_with : int -> countercreate_with start_value
creates a new counter with start_value. start_value must be >= 0.val set : counter -> int -> unitset value
sets the counter to value. value must be >= 0.val inc : counter -> unitOVERFLOW on overflow.val inc_by : counter -> int -> unitOVERFLOW on overflow.val dec : counter -> unitOVERFLOW if the counter drops below 0.val next : counter -> intOVERFLOW on overflow.val value : counter -> int