Ui_effect.Expertval eval :
on_exn:(Base.Exn.t -> Base.unit) ->
?on_further_exns:(Base.Exn.t -> Base.unit) ->
'a t ->
f:('a -> Base.unit) ->
Base.uniteval t ~f runs the given effect, and calls f when the effect completes, or on_exn if the effect does not return a result due to an exception. This function should not be called while constructing effects; it's intended for use by libraries that actually schedule effects, such as Bonsai, or Virtual_dom.
on_further_exns is called on exceptions that occur after the effect has gotten a result/exn. For example, if every branch of an all_parallel call raises an exception, on_exn would be called on the first exn, while on_further_exns would be called on the rest. There is no guarantee that the callbacks will be called in any particular order.
val handle :
on_exn:(Base.Exn.t -> Base.unit) ->
?on_further_exns:(Base.Exn.t -> Base.unit) ->
Base.unit t ->
Base.unithandle ~on_exn ?on_further_exns t is the same as eval ~on_exn ?on_further_exns t ~f:ignore.
type hide = | T : {value : 'a t;callback : 'a -> Base.unit;on_exn : Base.Exn.t -> Base.unit;} -> hideval handlers : (hide -> Base.unit) Base.Hashtbl.M(Base.Int).tval of_fun :
f:
(callback:('a -> Base.unit) ->
on_exn:(Base.Exn.t -> Base.unit) ->
Base.unit) ->
'a t