Without_infix.UnboxedA variant of the above type using unboxed floats. The operations are largely the same (but we can't currently share the module type across layouts.)
(This interface is somewhat sparser than what you see above; this is mostly not a choice and more we haven't implemented everything. Feel free to add!)
type boxed := tinclude Ppx_quickcheck_runtime.Quickcheckable.S with type t := tval quickcheck_generator : t Base_quickcheck.Generator.tval quickcheck_observer : t Base_quickcheck.Observer.tval quickcheck_shrinker : t Base_quickcheck.Shrinker.tinclude Typerep_lib.Typerepable.S with type t := tval typename_of_t : t Typerep_lib.Typename.t @@ portableval to_string : t -> stringval sexp_of_t : t -> Core.Sexp.tval t_of_sexp : Core.Sexp.t -> tinclude Core.Bin_prot.Binable.S__local with type t := tinclude Bin_prot.Binable.S_only_functions__local with type t := tval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : t Bin_prot.Read.vtag_readerThis function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.
val bin_shape_t : Bin_prot.Shape.tval bin_writer_t : t Bin_prot.Type_class.writerval bin_reader_t : t Bin_prot.Type_class.readerval bin_t : t Bin_prot.Type_class.tinclude Ppx_hash_lib.Hashable.S_any with type t := tval hash_fold_t : t Ppx_hash_lib.hash_foldval hash : t -> Ppx_hash_lib.Std.Hash.hash_valuemodule Optional_syntax : sig ... endinclude module type of Optional_syntax.Optional_syntaxval is_none : t -> boolval typerep_of_t : t Core.Typerep.tval none : unit -> tval is_some : t -> boolval some : float -> tval unchecked_some : float -> tval of_float_nan_as_none : float -> tval to_float_none_as_nan : t -> floatval zero : unit -> tval one : unit -> tval of_option : float option -> tval to_option : t -> float optionval some_if : bool -> float -> tval const : float -> tA workaround for the lack of unboxed float literals; strictly speaking one can use it for non constants but the name is a helpful reminder.
Computes numerator / denominator when denominator is nonzero, otherwise returns else_. This is done without allocating or branching by using Unboxed.select.
Returns false if t is none
val is_finite : t -> boolval is_inf : t -> boolval is_positive : t -> boolval is_non_negative : t -> boolval is_negative : t -> boolval is_non_positive : t -> boolval is_integer : t -> boolmodule Infix : sig ... endmodule Ieee_nan : sig ... endSee Ieee_nan of the boxed type
module O : sig ... endmodule Array : sig ... endmodule Ref : sig ... endmodule Stable : sig ... end