CCOptSourcemap_or ~default f o is f x if o = Some x, default otherwise.
map_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
Compare two options, using custom comparators for the value. None is always assumed to be less than Some _.
Test for equality between option types using a custom equality predicat.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
if_ f x is Some x if f x, None otherwise.
Return true iff there exists an element for which the provided function evaluates to true.
Return true iff the provided function evaluates to true for all elements.
get_or ~default o extracts the value from o, or returns default if o = None.
get_lazy default_fn x unwraps x, but if x = None it returns default_fn () instead.
sequence_l [x1; x2; ...; xn] returns Some [y1;y2;...;yn] if every xi is Some yi. Otherwise, if the list contains at least one None, the result is None.
wrap f x calls f x and returns Some y if f x = y. If f x raises any exception, the result is None. This can be useful to wrap functions such as Map.S.find.
wrap2 f x y is similar to wrap but for binary functions.
f <*> (Some x) returns Some (f x) and f <*> None returns None.
or_lazy ~else_ a is a if a is Some _, else_ () otherwise.
Apply Some or None depending on a boolean. More precisely, return_if false x is None, and return_if true x is Some x.
Let operators on OCaml >= 4.08.0, nothing otherwise
choice_seq s is similar to choice, but works on sequences. It returns the first Some x occurring in s, or None otherwise.
Same as Stdlib.Option.to_seq