Ui_effect.Or_errorLike Result above, this is extremely similar to Deferred.Or_error. A lot of the additional functions are missing, but can be added as needed
type nonrec 'a t = 'a Base.Or_error.t tinclude Base.Applicative.S with type 'a t := 'a tApplies the functions in one t to the values in another. Well-behaved applicatives satisfy these "laws", using <*> as infix apply:
return Fn.id <*> t is equivalent to treturn Fn.compose <*> tf <*> tg <*> tx is equivalent to tf <*> (tg <*> tx)return f <*> return x is equivalent to return (f x)tf <*> return x is equivalent to return (fun f -> f x) <*> tfCombines values in two ts as tuples. Using <*> as infix apply, equivalent to return (fun a b -> a, b) <*> ta <*> tb.
Combines the contents of two ts. Using <*> as infix apply, equivalent to return f <*> ta <*> tb.
Combines the contents of three ts. Using <*> as infix apply, equivalent to return f <*> ta <*> tb <*> tc.
module Applicative_infix : sig ... endinclude Base.Monad.S with type 'a t := 'a tval return : 'a 'i 'p 'q. 'a -> 'a tConvert a value to a t.
Sequences computations. bind t ~f computes f v for value(s) v in t. Well-behaved monads satisfy these "laws" (where ( >>= ) is the infix bind operator):
map t ~f is equivalent to bind t ~f:(fun x -> return (f x))return x >>= f is equivalent to f xt >>= return is equivalent to t(t >>= f) >>= g is equivalent to t >>= fun x -> f x >>= gCombines nested t into just one layer. Equivalent to bind t ~f:Fn.id.
Ignores contained values of t. Equivalent to map t ~f:ignore.
module Monad_infix : sig ... endmodule Let_syntax : sig ... endval fail : Base.Error.t -> _ tval error : Base.string -> 'a -> ('a -> Base.Sexp.t) -> _ tval error_s : Base.Sexp.t -> _ tval error_string : Base.string -> _ t