Kxclib.Option0
include module type of struct include Stdlib.Option end
val get : 'a t -> 'b
val v : 'a -> 'b t -> 'c
val v' : (unit -> 'a) -> 'b t -> 'c
val or_raise : exn -> 'a t -> 'b
val pp :
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'b t ->
unit
val of_bool : bool -> unit t
val some_if : bool -> 'a -> 'b t
protect ~capture f x
returns Some (f x)
except when
f x
throws an exn
s.t. capture exn = true
, it returns None
f x
throws an exn
s.t. capture exn = false
, it rethrows exn
~capture
defaults to fun _exn -> true
try_make ~capture f
is protect ~capture f ()
, thus see protect
~capture
defaults to fun _exn -> true