Make.OptionSignature from Lwtreslib's option module
val none_e : ('a option, 'trace) Pervasives.resultval none_s : 'a option Lwt.tval none_es : ('a option, 'trace) Pervasives.result Lwt.tval some_e : 'a -> ('a option, 'trace) Pervasives.resultval some_s : 'a -> 'a option Lwt.tval some_es : 'a -> ('a option, 'trace) Pervasives.result Lwt.tval value_e : 'a option -> error:'trace -> ('a, 'trace) Pervasives.resultval value_fe :
'a option ->
error:(unit -> 'trace) ->
('a, 'trace) Pervasives.resultval map_e :
('a -> ('b, 'trace) Pervasives.result) ->
'a option ->
('b option, 'trace) Pervasives.resultval map_es :
('a -> ('b, 'trace) Pervasives.result Lwt.t) ->
'a option ->
('b option, 'trace) Pervasives.result Lwt.tval iter_e :
('a -> (unit, 'trace) Pervasives.result) ->
'a option ->
(unit, 'trace) Pervasives.resultval iter_es :
('a -> (unit, 'trace) Pervasives.result Lwt.t) ->
'a option ->
(unit, 'trace) Pervasives.result Lwt.tval to_result : none:'trace -> 'a option -> ('a, 'trace) Pervasives.resultval of_result : ('a, 'e) Pervasives.result -> 'a optionval to_seq : 'a option -> 'a Seq.tcatch f is Some (f ()) if f does not raise an exception, it is None otherwise.
You should only use catch when you truly do not care about what exception may be raised during the evaluation of f (). If you need to inspect the raised exception, or if you need to pass it along, consider Result.catch instead.
If catch_only is set, then only exceptions e such that catch_only e is true are caught.
Whether catch_only is set or not, you cannot catch non-deterministic runtime exceptions of OCaml such as Stack_overflow and Out_of_memory nor system exceptions such as Unix.Unix_error.
catch_s f is a promise that resolves to Some x if and when f () resolves to x. Alternatively, it resolves to None if and when f () is rejected.
You should only use catch_s when you truly do not care about what exception may be raised during the evaluation of f (). If you need to inspect the raised exception, or if you need to pass it along, consider Result.catch_s instead.
If catch_only is set, then only exceptions e such that catch_only e is true are caught.
Whether catch_only is set or not, you cannot catch non-deterministic runtime exceptions of OCaml such as Stack_overflow and Out_of_memory nor system exceptions such as Unix.Unix_error.