Async_kernel.Invariantinclude module type of Core.Invariantmodule type S = Base.Invariant.Smodule type S1__bits64 = Base.Invariant.S1__bits64module type S2__bits64__bits64 = Base.Invariant.S2__bits64__bits64module type S3__bits64__bits64__bits64 =
Base.Invariant.S3__bits64__bits64__bits64module type S3__bits64__bits64__bits32 =
Base.Invariant.S3__bits64__bits64__bits32module type S3__bits64__bits64__word = Base.Invariant.S3__bits64__bits64__wordmodule type S3__bits64__bits64__float64 =
Base.Invariant.S3__bits64__bits64__float64module type S3__bits64__bits64__float32 =
Base.Invariant.S3__bits64__bits64__float32module type S3__bits64__bits64__value =
Base.Invariant.S3__bits64__bits64__valuemodule type S2__bits64__bits32 = Base.Invariant.S2__bits64__bits32module type S3__bits64__bits32__bits64 =
Base.Invariant.S3__bits64__bits32__bits64module type S3__bits64__bits32__bits32 =
Base.Invariant.S3__bits64__bits32__bits32module type S3__bits64__bits32__word = Base.Invariant.S3__bits64__bits32__wordmodule type S3__bits64__bits32__float64 =
Base.Invariant.S3__bits64__bits32__float64module type S3__bits64__bits32__float32 =
Base.Invariant.S3__bits64__bits32__float32module type S3__bits64__bits32__value =
Base.Invariant.S3__bits64__bits32__valuemodule type S2__bits64__word = Base.Invariant.S2__bits64__wordmodule type S3__bits64__word__bits64 = Base.Invariant.S3__bits64__word__bits64module type S3__bits64__word__bits32 = Base.Invariant.S3__bits64__word__bits32module type S3__bits64__word__word = Base.Invariant.S3__bits64__word__wordmodule type S3__bits64__word__float64 =
Base.Invariant.S3__bits64__word__float64module type S3__bits64__word__float32 =
Base.Invariant.S3__bits64__word__float32module type S3__bits64__word__value = Base.Invariant.S3__bits64__word__valuemodule type S2__bits64__float64 = Base.Invariant.S2__bits64__float64module type S3__bits64__float64__bits64 =
Base.Invariant.S3__bits64__float64__bits64module type S3__bits64__float64__bits32 =
Base.Invariant.S3__bits64__float64__bits32module type S3__bits64__float64__word =
Base.Invariant.S3__bits64__float64__wordmodule type S3__bits64__float64__float64 =
Base.Invariant.S3__bits64__float64__float64module type S3__bits64__float64__float32 =
Base.Invariant.S3__bits64__float64__float32module type S3__bits64__float64__value =
Base.Invariant.S3__bits64__float64__valuemodule type S2__bits64__float32 = Base.Invariant.S2__bits64__float32module type S3__bits64__float32__bits64 =
Base.Invariant.S3__bits64__float32__bits64module type S3__bits64__float32__bits32 =
Base.Invariant.S3__bits64__float32__bits32module type S3__bits64__float32__word =
Base.Invariant.S3__bits64__float32__wordmodule type S3__bits64__float32__float64 =
Base.Invariant.S3__bits64__float32__float64module type S3__bits64__float32__float32 =
Base.Invariant.S3__bits64__float32__float32module type S3__bits64__float32__value =
Base.Invariant.S3__bits64__float32__valuemodule type S2__bits64__value = Base.Invariant.S2__bits64__valuemodule type S3__bits64__value__bits64 =
Base.Invariant.S3__bits64__value__bits64module type S3__bits64__value__bits32 =
Base.Invariant.S3__bits64__value__bits32module type S3__bits64__value__word = Base.Invariant.S3__bits64__value__wordmodule type S3__bits64__value__float64 =
Base.Invariant.S3__bits64__value__float64module type S3__bits64__value__float32 =
Base.Invariant.S3__bits64__value__float32module type S3__bits64__value__value = Base.Invariant.S3__bits64__value__valuemodule type S1__bits32 = Base.Invariant.S1__bits32module type S2__bits32__bits64 = Base.Invariant.S2__bits32__bits64module type S3__bits32__bits64__bits64 =
Base.Invariant.S3__bits32__bits64__bits64module type S3__bits32__bits64__bits32 =
Base.Invariant.S3__bits32__bits64__bits32module type S3__bits32__bits64__word = Base.Invariant.S3__bits32__bits64__wordmodule type S3__bits32__bits64__float64 =
Base.Invariant.S3__bits32__bits64__float64module type S3__bits32__bits64__float32 =
Base.Invariant.S3__bits32__bits64__float32module type S3__bits32__bits64__value =
Base.Invariant.S3__bits32__bits64__valuemodule type S2__bits32__bits32 = Base.Invariant.S2__bits32__bits32module type S3__bits32__bits32__bits64 =
Base.Invariant.S3__bits32__bits32__bits64module type S3__bits32__bits32__bits32 =
Base.Invariant.S3__bits32__bits32__bits32module type S3__bits32__bits32__word = Base.Invariant.S3__bits32__bits32__wordmodule type S3__bits32__bits32__float64 =
Base.Invariant.S3__bits32__bits32__float64module type S3__bits32__bits32__float32 =
Base.Invariant.S3__bits32__bits32__float32module type S3__bits32__bits32__value =
Base.Invariant.S3__bits32__bits32__valuemodule type S2__bits32__word = Base.Invariant.S2__bits32__wordmodule type S3__bits32__word__bits64 = Base.Invariant.S3__bits32__word__bits64module type S3__bits32__word__bits32 = Base.Invariant.S3__bits32__word__bits32module type S3__bits32__word__word = Base.Invariant.S3__bits32__word__wordmodule type S3__bits32__word__float64 =
Base.Invariant.S3__bits32__word__float64module type S3__bits32__word__float32 =
Base.Invariant.S3__bits32__word__float32module type S3__bits32__word__value = Base.Invariant.S3__bits32__word__valuemodule type S2__bits32__float64 = Base.Invariant.S2__bits32__float64module type S3__bits32__float64__bits64 =
Base.Invariant.S3__bits32__float64__bits64module type S3__bits32__float64__bits32 =
Base.Invariant.S3__bits32__float64__bits32module type S3__bits32__float64__word =
Base.Invariant.S3__bits32__float64__wordmodule type S3__bits32__float64__float64 =
Base.Invariant.S3__bits32__float64__float64module type S3__bits32__float64__float32 =
Base.Invariant.S3__bits32__float64__float32module type S3__bits32__float64__value =
Base.Invariant.S3__bits32__float64__valuemodule type S2__bits32__float32 = Base.Invariant.S2__bits32__float32module type S3__bits32__float32__bits64 =
Base.Invariant.S3__bits32__float32__bits64module type S3__bits32__float32__bits32 =
Base.Invariant.S3__bits32__float32__bits32module type S3__bits32__float32__word =
Base.Invariant.S3__bits32__float32__wordmodule type S3__bits32__float32__float64 =
Base.Invariant.S3__bits32__float32__float64module type S3__bits32__float32__float32 =
Base.Invariant.S3__bits32__float32__float32module type S3__bits32__float32__value =
Base.Invariant.S3__bits32__float32__valuemodule type S2__bits32__value = Base.Invariant.S2__bits32__valuemodule type S3__bits32__value__bits64 =
Base.Invariant.S3__bits32__value__bits64module type S3__bits32__value__bits32 =
Base.Invariant.S3__bits32__value__bits32module type S3__bits32__value__word = Base.Invariant.S3__bits32__value__wordmodule type S3__bits32__value__float64 =
Base.Invariant.S3__bits32__value__float64module type S3__bits32__value__float32 =
Base.Invariant.S3__bits32__value__float32module type S3__bits32__value__value = Base.Invariant.S3__bits32__value__valuemodule type S1__word = Base.Invariant.S1__wordmodule type S2__word__bits64 = Base.Invariant.S2__word__bits64module type S3__word__bits64__bits64 = Base.Invariant.S3__word__bits64__bits64module type S3__word__bits64__bits32 = Base.Invariant.S3__word__bits64__bits32module type S3__word__bits64__word = Base.Invariant.S3__word__bits64__wordmodule type S3__word__bits64__float64 =
Base.Invariant.S3__word__bits64__float64module type S3__word__bits64__float32 =
Base.Invariant.S3__word__bits64__float32module type S3__word__bits64__value = Base.Invariant.S3__word__bits64__valuemodule type S2__word__bits32 = Base.Invariant.S2__word__bits32module type S3__word__bits32__bits64 = Base.Invariant.S3__word__bits32__bits64module type S3__word__bits32__bits32 = Base.Invariant.S3__word__bits32__bits32module type S3__word__bits32__word = Base.Invariant.S3__word__bits32__wordmodule type S3__word__bits32__float64 =
Base.Invariant.S3__word__bits32__float64module type S3__word__bits32__float32 =
Base.Invariant.S3__word__bits32__float32module type S3__word__bits32__value = Base.Invariant.S3__word__bits32__valuemodule type S2__word__word = Base.Invariant.S2__word__wordmodule type S3__word__word__bits64 = Base.Invariant.S3__word__word__bits64module type S3__word__word__bits32 = Base.Invariant.S3__word__word__bits32module type S3__word__word__word = Base.Invariant.S3__word__word__wordmodule type S3__word__word__float64 = Base.Invariant.S3__word__word__float64module type S3__word__word__float32 = Base.Invariant.S3__word__word__float32module type S3__word__word__value = Base.Invariant.S3__word__word__valuemodule type S2__word__float64 = Base.Invariant.S2__word__float64module type S3__word__float64__bits64 =
Base.Invariant.S3__word__float64__bits64module type S3__word__float64__bits32 =
Base.Invariant.S3__word__float64__bits32module type S3__word__float64__word = Base.Invariant.S3__word__float64__wordmodule type S3__word__float64__float64 =
Base.Invariant.S3__word__float64__float64module type S3__word__float64__float32 =
Base.Invariant.S3__word__float64__float32module type S3__word__float64__value = Base.Invariant.S3__word__float64__valuemodule type S2__word__float32 = Base.Invariant.S2__word__float32module type S3__word__float32__bits64 =
Base.Invariant.S3__word__float32__bits64module type S3__word__float32__bits32 =
Base.Invariant.S3__word__float32__bits32module type S3__word__float32__word = Base.Invariant.S3__word__float32__wordmodule type S3__word__float32__float64 =
Base.Invariant.S3__word__float32__float64module type S3__word__float32__float32 =
Base.Invariant.S3__word__float32__float32module type S3__word__float32__value = Base.Invariant.S3__word__float32__valuemodule type S2__word__value = Base.Invariant.S2__word__valuemodule type S3__word__value__bits64 = Base.Invariant.S3__word__value__bits64module type S3__word__value__bits32 = Base.Invariant.S3__word__value__bits32module type S3__word__value__word = Base.Invariant.S3__word__value__wordmodule type S3__word__value__float64 = Base.Invariant.S3__word__value__float64module type S3__word__value__float32 = Base.Invariant.S3__word__value__float32module type S3__word__value__value = Base.Invariant.S3__word__value__valuemodule type S1__float64 = Base.Invariant.S1__float64module type S2__float64__bits64 = Base.Invariant.S2__float64__bits64module type S3__float64__bits64__bits64 =
Base.Invariant.S3__float64__bits64__bits64module type S3__float64__bits64__bits32 =
Base.Invariant.S3__float64__bits64__bits32module type S3__float64__bits64__word =
Base.Invariant.S3__float64__bits64__wordmodule type S3__float64__bits64__float64 =
Base.Invariant.S3__float64__bits64__float64module type S3__float64__bits64__float32 =
Base.Invariant.S3__float64__bits64__float32module type S3__float64__bits64__value =
Base.Invariant.S3__float64__bits64__valuemodule type S2__float64__bits32 = Base.Invariant.S2__float64__bits32module type S3__float64__bits32__bits64 =
Base.Invariant.S3__float64__bits32__bits64module type S3__float64__bits32__bits32 =
Base.Invariant.S3__float64__bits32__bits32module type S3__float64__bits32__word =
Base.Invariant.S3__float64__bits32__wordmodule type S3__float64__bits32__float64 =
Base.Invariant.S3__float64__bits32__float64module type S3__float64__bits32__float32 =
Base.Invariant.S3__float64__bits32__float32module type S3__float64__bits32__value =
Base.Invariant.S3__float64__bits32__valuemodule type S2__float64__word = Base.Invariant.S2__float64__wordmodule type S3__float64__word__bits64 =
Base.Invariant.S3__float64__word__bits64module type S3__float64__word__bits32 =
Base.Invariant.S3__float64__word__bits32module type S3__float64__word__word = Base.Invariant.S3__float64__word__wordmodule type S3__float64__word__float64 =
Base.Invariant.S3__float64__word__float64module type S3__float64__word__float32 =
Base.Invariant.S3__float64__word__float32module type S3__float64__word__value = Base.Invariant.S3__float64__word__valuemodule type S2__float64__float64 = Base.Invariant.S2__float64__float64module type S3__float64__float64__bits64 =
Base.Invariant.S3__float64__float64__bits64module type S3__float64__float64__bits32 =
Base.Invariant.S3__float64__float64__bits32module type S3__float64__float64__word =
Base.Invariant.S3__float64__float64__wordmodule type S3__float64__float64__float64 =
Base.Invariant.S3__float64__float64__float64module type S3__float64__float64__float32 =
Base.Invariant.S3__float64__float64__float32module type S3__float64__float64__value =
Base.Invariant.S3__float64__float64__valuemodule type S2__float64__float32 = Base.Invariant.S2__float64__float32module type S3__float64__float32__bits64 =
Base.Invariant.S3__float64__float32__bits64module type S3__float64__float32__bits32 =
Base.Invariant.S3__float64__float32__bits32module type S3__float64__float32__word =
Base.Invariant.S3__float64__float32__wordmodule type S3__float64__float32__float64 =
Base.Invariant.S3__float64__float32__float64module type S3__float64__float32__float32 =
Base.Invariant.S3__float64__float32__float32module type S3__float64__float32__value =
Base.Invariant.S3__float64__float32__valuemodule type S2__float64__value = Base.Invariant.S2__float64__valuemodule type S3__float64__value__bits64 =
Base.Invariant.S3__float64__value__bits64module type S3__float64__value__bits32 =
Base.Invariant.S3__float64__value__bits32module type S3__float64__value__word = Base.Invariant.S3__float64__value__wordmodule type S3__float64__value__float64 =
Base.Invariant.S3__float64__value__float64module type S3__float64__value__float32 =
Base.Invariant.S3__float64__value__float32module type S3__float64__value__value =
Base.Invariant.S3__float64__value__valuemodule type S1__float32 = Base.Invariant.S1__float32module type S2__float32__bits64 = Base.Invariant.S2__float32__bits64module type S3__float32__bits64__bits64 =
Base.Invariant.S3__float32__bits64__bits64module type S3__float32__bits64__bits32 =
Base.Invariant.S3__float32__bits64__bits32module type S3__float32__bits64__word =
Base.Invariant.S3__float32__bits64__wordmodule type S3__float32__bits64__float64 =
Base.Invariant.S3__float32__bits64__float64module type S3__float32__bits64__float32 =
Base.Invariant.S3__float32__bits64__float32module type S3__float32__bits64__value =
Base.Invariant.S3__float32__bits64__valuemodule type S2__float32__bits32 = Base.Invariant.S2__float32__bits32module type S3__float32__bits32__bits64 =
Base.Invariant.S3__float32__bits32__bits64module type S3__float32__bits32__bits32 =
Base.Invariant.S3__float32__bits32__bits32module type S3__float32__bits32__word =
Base.Invariant.S3__float32__bits32__wordmodule type S3__float32__bits32__float64 =
Base.Invariant.S3__float32__bits32__float64module type S3__float32__bits32__float32 =
Base.Invariant.S3__float32__bits32__float32module type S3__float32__bits32__value =
Base.Invariant.S3__float32__bits32__valuemodule type S2__float32__word = Base.Invariant.S2__float32__wordmodule type S3__float32__word__bits64 =
Base.Invariant.S3__float32__word__bits64module type S3__float32__word__bits32 =
Base.Invariant.S3__float32__word__bits32module type S3__float32__word__word = Base.Invariant.S3__float32__word__wordmodule type S3__float32__word__float64 =
Base.Invariant.S3__float32__word__float64module type S3__float32__word__float32 =
Base.Invariant.S3__float32__word__float32module type S3__float32__word__value = Base.Invariant.S3__float32__word__valuemodule type S2__float32__float64 = Base.Invariant.S2__float32__float64module type S3__float32__float64__bits64 =
Base.Invariant.S3__float32__float64__bits64module type S3__float32__float64__bits32 =
Base.Invariant.S3__float32__float64__bits32module type S3__float32__float64__word =
Base.Invariant.S3__float32__float64__wordmodule type S3__float32__float64__float64 =
Base.Invariant.S3__float32__float64__float64module type S3__float32__float64__float32 =
Base.Invariant.S3__float32__float64__float32module type S3__float32__float64__value =
Base.Invariant.S3__float32__float64__valuemodule type S2__float32__float32 = Base.Invariant.S2__float32__float32module type S3__float32__float32__bits64 =
Base.Invariant.S3__float32__float32__bits64module type S3__float32__float32__bits32 =
Base.Invariant.S3__float32__float32__bits32module type S3__float32__float32__word =
Base.Invariant.S3__float32__float32__wordmodule type S3__float32__float32__float64 =
Base.Invariant.S3__float32__float32__float64module type S3__float32__float32__float32 =
Base.Invariant.S3__float32__float32__float32module type S3__float32__float32__value =
Base.Invariant.S3__float32__float32__valuemodule type S2__float32__value = Base.Invariant.S2__float32__valuemodule type S3__float32__value__bits64 =
Base.Invariant.S3__float32__value__bits64module type S3__float32__value__bits32 =
Base.Invariant.S3__float32__value__bits32module type S3__float32__value__word = Base.Invariant.S3__float32__value__wordmodule type S3__float32__value__float64 =
Base.Invariant.S3__float32__value__float64module type S3__float32__value__float32 =
Base.Invariant.S3__float32__value__float32module type S3__float32__value__value =
Base.Invariant.S3__float32__value__valuemodule type S1 = Base.Invariant.S1module type S2__value__bits64 = Base.Invariant.S2__value__bits64module type S3__value__bits64__bits64 =
Base.Invariant.S3__value__bits64__bits64module type S3__value__bits64__bits32 =
Base.Invariant.S3__value__bits64__bits32module type S3__value__bits64__word = Base.Invariant.S3__value__bits64__wordmodule type S3__value__bits64__float64 =
Base.Invariant.S3__value__bits64__float64module type S3__value__bits64__float32 =
Base.Invariant.S3__value__bits64__float32module type S3__value__bits64__value = Base.Invariant.S3__value__bits64__valuemodule type S2__value__bits32 = Base.Invariant.S2__value__bits32module type S3__value__bits32__bits64 =
Base.Invariant.S3__value__bits32__bits64module type S3__value__bits32__bits32 =
Base.Invariant.S3__value__bits32__bits32module type S3__value__bits32__word = Base.Invariant.S3__value__bits32__wordmodule type S3__value__bits32__float64 =
Base.Invariant.S3__value__bits32__float64module type S3__value__bits32__float32 =
Base.Invariant.S3__value__bits32__float32module type S3__value__bits32__value = Base.Invariant.S3__value__bits32__valuemodule type S2__value__word = Base.Invariant.S2__value__wordmodule type S3__value__word__bits64 = Base.Invariant.S3__value__word__bits64module type S3__value__word__bits32 = Base.Invariant.S3__value__word__bits32module type S3__value__word__word = Base.Invariant.S3__value__word__wordmodule type S3__value__word__float64 = Base.Invariant.S3__value__word__float64module type S3__value__word__float32 = Base.Invariant.S3__value__word__float32module type S3__value__word__value = Base.Invariant.S3__value__word__valuemodule type S2__value__float64 = Base.Invariant.S2__value__float64module type S3__value__float64__bits64 =
Base.Invariant.S3__value__float64__bits64module type S3__value__float64__bits32 =
Base.Invariant.S3__value__float64__bits32module type S3__value__float64__word = Base.Invariant.S3__value__float64__wordmodule type S3__value__float64__float64 =
Base.Invariant.S3__value__float64__float64module type S3__value__float64__float32 =
Base.Invariant.S3__value__float64__float32module type S3__value__float64__value =
Base.Invariant.S3__value__float64__valuemodule type S2__value__float32 = Base.Invariant.S2__value__float32module type S3__value__float32__bits64 =
Base.Invariant.S3__value__float32__bits64module type S3__value__float32__bits32 =
Base.Invariant.S3__value__float32__bits32module type S3__value__float32__word = Base.Invariant.S3__value__float32__wordmodule type S3__value__float32__float64 =
Base.Invariant.S3__value__float32__float64module type S3__value__float32__float32 =
Base.Invariant.S3__value__float32__float32module type S3__value__float32__value =
Base.Invariant.S3__value__float32__valuemodule type S2 = Base.Invariant.S2module type S3__value__value__bits64 = Base.Invariant.S3__value__value__bits64module type S3__value__value__bits32 = Base.Invariant.S3__value__value__bits32module type S3__value__value__word = Base.Invariant.S3__value__value__wordmodule type S3__value__value__float64 =
Base.Invariant.S3__value__value__float64module type S3__value__value__float32 =
Base.Invariant.S3__value__value__float32module type S3 = Base.Invariant.S3val invariant :
here:lexing_position ->
'a ->
('a -> Sexplib0.Sexp.t) @ local ->
((unit -> unit) @ local ->
unit) @ localinvariant t sexp_of_t f runs f (), and if f raises, wraps the exception in an Error.t that states "invariant failed" and includes both the exception raised by f, as well as sexp_of_t t. Idiomatic usage looks like:
invariant t [%sexp_of: t] (fun () ->
... check t's invariants ... )For polymorphic types:
let invariant check_a t =
Invariant.invariant t [%sexp_of: _ t] (fun () -> ... )It's okay to use [%sexp_of: _ t] because the exceptions raised by check_a will show the parts that are opaque at top-level.
val check_field : 'a -> 'b t -> ('a, 'b) Base.Field.t -> unitcheck_field is used when checking invariants using Fields.iter. It wraps an exception raised when checking a field with the field's name. Idiomatic usage looks like:
type t =
{ foo : Foo.t
; bar : Bar.t
}
[@@deriving fields]
let invariant t : unit =
Invariant.invariant t [%sexp_of: t] (fun () ->
let check f = Invariant.check_field t f in
Fields.iter ~foo:(check Foo.invariant) ~bar:(check Bar.invariant))
;;module Async : sig ... end