module type Spec = sig .. end
Specification of general number properties
type t
include Core.Std.Interfaces.Comparable with type t := t
include Core.Std.Interfaces.Floatable with type t := t
include Core.Std.Hashable.S_binable with type t := t
include Core.Std.Interfaces.Sexpable with type t := t
include Core.Std.Interfaces.Stringable with type t := t
include Core.Std.Interfaces.Binable with type t := t
module type Verified_spec = sig .. end
Specification of numbers with constraint checks
include Spec
val check : t -> (unit, string) Core.Std.Result.t
module type S = sig .. end
Signature of numbers that have a verified (t) and unverified (repr) representation and a function to verify the latter.
include Spec
type repr
val verify : repr -> t
module type S0 = sig .. end
Signature of numbers that also have a zero
include S
val zero : t
module Make_verified : 
functor (Spec : Verified_spec) -> S with type repr = Spec.t with type t = Spec.t
Functor for making constrained numbers from specifications. This functor enforces the invariant through a private type.
module Make_verified_unsafe : 
functor (Spec : Verified_spec) -> S with type repr = Spec.t with type t = Spec.t
Same as Make_verified, but does not enforce invariants. Useful for extending verified numbers with more features before "sealing" the type with a private declaration.
module type Verified_std_spec = sig .. end
Specification used for standard numbers (Int.t, Int32.t, Int63.t Int64.t, Nativeint.t, Float.t) to enrich them with Pos.t, Pos0.t, Neg.t, and Neg0.t modules, and the Make_bounded and Make_bounded_unsafe functors.
include Spec
val module_name : string
val zero : t
module type Verified_std = sig .. end
Signature of standard numbers (Int.t, Int32.t, Int63.t Int64.t, Nativeint.t, Float.t) to enrich them with Pos.t, Pos0.t, Neg.t, and Neg0.t modules, and the Make_bounded and Make_bounded_unsafe functors.
type repr
module type S = S with type repr = repr
Abbreviations
module type S0 = S0 with type repr = repr
module Pos : S with type t = repr
Positive and negative numbers with and without zero.
module Pos0 : S0 with type t = repr
module Neg : S with type t = repr
module Neg0 : S0 with type t = repr
module type Bounded_spec = sig .. end
Specification of bounded numbers
val name : string
val lower : repr
val upper : repr
module type Bounded = sig .. end
Signature of bounded numbers
include Bounded_spec
include S
module Make_bounded : 
functor (Spec : Bounded_spec) -> Bounded with type t = repr
Functor of creating bounded numbers
Unsafe modules and functors that still fully expose the representation for extensibility.
module Pos_unsafe : S with type t = repr
module Pos0_unsafe : S0 with type t = repr
module Neg_unsafe : S with type t = repr
module Neg0_unsafe : S0 with type t = repr
module Make_bounded_unsafe : 
functor (Spec : Bounded_spec) -> Bounded with type t = repr
module Make_verified_std : 
functor (Spec : Verified_std_spec) -> Verified_std with type repr = Spec.t
Functor for enriching standard numbers (Int.t, Int32.t, Int63.t Int64.t, Nativeint.t, Float.t) with Pos.t, Pos0.t, Neg.t, and Neg0.t modules, and the Make_bounded and Make_bounded_unsafe functors.