diff --git a/dev/containers/CCOpt/index.html b/dev/containers/CCOpt/index.html index 43d25931..f18a340e 100644 --- a/dev/containers/CCOpt/index.html +++ b/dev/containers/CCOpt/index.html @@ -1,5 +1,5 @@ -
CCOptPrevious Option module
include module type of CCOptionmap f o applies the function f to the element inside o, if any.
val map_or : default:'b -> ( 'a -> 'b ) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : ( unit -> 'b ) -> ( 'a -> 'b ) -> 'a t -> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ( 'a -> unit ) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.
val exists : ( 'a -> bool ) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ( 'a -> bool ) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : ( unit -> 'a ) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is 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 ?handler 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.
val wrap2 :
+CCOpt (containers.CCOpt) Module CCOpt
Previous Option module
include module type of CCOption
map f o applies the function f to the element inside o, if any.
val map_or : default:'b -> ( 'a -> 'b ) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : ( unit -> 'b ) -> ( 'a -> 'b ) -> 'a t -> 'bmap_lazy default_fn f o is f x if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ( 'a -> unit ) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.
val exists : ( 'a -> bool ) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ( 'a -> bool ) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : ( unit -> 'a ) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is 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 ?handler 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.
val wrap2 :
?handler:( exn -> bool ) ->
( 'a -> 'b -> 'c ) ->
'a ->
diff --git a/dev/containers/CCOption/index.html b/dev/containers/CCOption/index.html
index 4bd88c33..ea567616 100644
--- a/dev/containers/CCOption/index.html
+++ b/dev/containers/CCOption/index.html
@@ -1,5 +1,5 @@
-CCOption (containers.CCOption) Module CCOption
Basic operations on the option type.
This module replaces `CCOpt`.
map f o applies the function f to the element inside o, if any.
val map_or : default:'b -> ( 'a -> 'b ) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : ( unit -> 'b ) -> ( 'a -> 'b ) -> 'a t -> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ( 'a -> unit ) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.
val exists : ( 'a -> bool ) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ( 'a -> bool ) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : ( unit -> 'a ) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is 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 ?handler 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.
val wrap2 :
+CCOption (containers.CCOption) Module CCOption
Basic operations on the option type.
This module replaces `CCOpt`.
map f o applies the function f to the element inside o, if any.
val map_or : default:'b -> ( 'a -> 'b ) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : ( unit -> 'b ) -> ( 'a -> 'b ) -> 'a t -> 'bmap_lazy default_fn f o is f x if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ( 'a -> unit ) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.
val exists : ( 'a -> bool ) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ( 'a -> bool ) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : ( unit -> 'a ) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is 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 ?handler 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.