Misc_stdlib.Maybe_boundedA bounded non-negative integer. The possible ranges are 0 ..< n, represented by Bounded { bound = n} and 0 ..< ∞ represented by Unbounded.
val decr : t -> unitdecr decreases the current bound and truncates at zero. As such, decr and then incr is not always a no-op.
val incr : t -> unitincr increases the current bound. Raises an exception when attempting to increment max_int.
val is_depleted : t -> boolval is_in_bounds : int -> t -> boolis_in_bounds n t returns true if n is in bounds. A number counts as in bounds if it is non-negative and strictly smaller than the bound. For Unbounded, returns true if n >= 0.
val is_out_of_bounds : int -> t -> boolis_out_of_bounds n t returns true if n is out of bounds. A number is out of bounds if it is negative or greater than or equal to the bound. For Unbounded, returns false if n < 0 and true otherwise.
val of_option : int option -> tof_option opt maps None to no bound and Some n to the bound n (not inclusive).
val of_int : int -> tof_int n creates a bounded integer with bound n (not inclusive).