package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t =
  1. | Aborted
    (*

    Aborted indicates that the effect was aborted before it even started. If an effect starts, then it should complete with some kind of result - Effect does not support cancellation in general.

    *)
  2. | Finished of 'a
    (*

    Finished x indicates that an effect successfully completed with value x.

    *)
include Sexplib0.Sexpable.S1 with type 'a t := 'a t
val t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Equal.S1 with type 'a t := 'a t
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val collapse_to_or_error : ?tag_s:Core.Sexp.t lazy_t -> 'a Core.Or_error.t t -> 'a Core.Or_error.t

Collapses values of type 'a Or_error.t t a plain Or_error.t, where the Aborted case is transformed into an error.

The tag_s parameter can be used to add additional info to the error.

val collapse_fun_to_or_error : ?sexp_of_input:('a -> Core.Sexp.t) -> ('a -> 'b Core.Or_error.t t Effect.t) -> 'a -> 'b Core.Or_error.t Effect.t

Like collapse_to_or_error, but transforms a function that returns an 'a Or_error.t t instead of just the value.

OCaml

Innovation. Community. Security.