Module Action.Result

Action results.

An action result is the value returned by an action when it synchronizes.

Results

type 'a t =
  1. | Value of 'a
  2. | Exn of exn * Stdlib.Printexc.raw_backtrace

The type for action results.

val none : 'a t

none is a stub value. Except for initializing data structures, it should not be used. If returned or deep_continued it raises Assert_failure.

val of_fun_run : (unit -> 'a) -> 'a t

of_fun_run f executes f () and turns it into a result.

Continuing

val return : 'a t -> 'a

return r returns or raises the result at the call point.

val deep_continue : ('a, 'b) Stdlib.Effect.Deep.continuation -> 'a t -> 'b

deep_continue k r continues k with the result r.

val deep_continue_thunk : ('a, 'b) Stdlib.Effect.Deep.continuation -> 'a t -> unit -> 'b

deep_continue_thunk k r is fun () -> deep_continue k r.

val some_deep_continue_thunk : ('a option, 'b) Stdlib.Effect.Deep.continuation -> 'a t -> unit -> 'b

some_deep_continue_thunk is like deep_continue_thunk but it wraps a Value s into Value (Some v).