Module Force_once
A "force_once" is a thunk that can only be forced once. Subsequent forces will raise an exception.
val create : (unit -> 'a) -> 'a t
create f
creates a newforce_once
.
val force : 'a t -> 'a
force t
runs the thunk if it hadn't already been forced, else it raises an exception.
val ignore : unit -> unit t
ignore ()
=create (fun () -> ())
val sexp_of_t : ('a -> Core_kernel.Sexp.t) -> 'a t -> Core_kernel.Sexp.t