From c3cec7cf3b7ac1c4d81d2d301a9e042a30b0bf51 Mon Sep 17 00:00:00 2001 From: c-cube Date: Wed, 23 Feb 2022 04:20:40 +0000 Subject: [PATCH] deploy: 40189757cae1de9e43bf9c7ac92d7412868b2846 --- .../CCMutHeap/Make/argument-1-X/index.html | 2 +- .../CCMutHeap_intf/module-type-RANKED/index.html | 2 +- dev/containers-data/CCPersistentArray/index.html | 2 +- .../CCPool/Make/Fut/Infix/index.html | 2 +- dev/containers-thread/CCPool/Make/Fut/index.html | 2 +- dev/containers/CCArray/Floatarray/index.html | 2 ++ dev/containers/CCArray/index.html | 2 +- dev/containers/CCArrayLabels/index.html | 5 ++--- dev/containers/CCFun/index.html | 2 +- dev/containers/CCInt/index.html | 2 +- dev/containers/CCList/Infix/index.html | 4 ++-- dev/containers/CCList/index.html | 6 +++--- dev/containers/CCListLabels/Infix/index.html | 4 ++-- dev/containers/CCListLabels/index.html | 4 ++-- dev/containers/CCMonomorphicShims_/index.html | 2 -- dev/containers/CCOpt/Infix/index.html | 2 +- dev/containers/CCOpt/index.html | 2 +- dev/containers/CCOption/Infix/index.html | 2 +- dev/containers/CCOption/index.html | 2 +- dev/containers/CCResult/Infix/index.html | 5 +---- dev/containers/CCResult/index.html | 5 +---- dev/containers/CCShimsArrayLabels_/.dummy | 0 .../CCShimsArrayLabels_/Floatarray/index.html | 2 -- dev/containers/CCShimsArrayLabels_/index.html | 13 ------------- dev/containers/CCShimsArray_/.dummy | 0 dev/containers/CCShimsArray_/index.html | 2 -- dev/containers/CCShimsFormat_/.dummy | 0 dev/containers/CCShimsFormat_/index.html | 12 ------------ dev/containers/CCShimsFun_/.dummy | 0 dev/containers/CCShimsFun_/index.html | 2 -- dev/containers/CCShimsInt_/.dummy | 0 dev/containers/CCShimsInt_/index.html | 2 -- dev/containers/CCShimsList_/.dummy | 0 dev/containers/CCShimsList_/index.html | 5 ----- dev/containers/CCShimsMkLetList_/.dummy | 0 .../CCShimsMkLetList_/Make/argument-1-X/index.html | 2 -- dev/containers/CCShimsMkLetList_/Make/index.html | 2 -- dev/containers/CCShimsMkLetList_/index.html | 2 -- .../CCShimsMkLetList_/module-type-S/index.html | 9 --------- dev/containers/CCShimsMkLet_/.dummy | 0 .../CCShimsMkLet_/Make/argument-1-X/index.html | 2 -- dev/containers/CCShimsMkLet_/Make/index.html | 2 -- .../CCShimsMkLet_/Make2/argument-1-X/index.html | 2 -- dev/containers/CCShimsMkLet_/Make2/index.html | 5 ----- dev/containers/CCShimsMkLet_/index.html | 2 -- .../CCShimsMkLet_/module-type-S/index.html | 2 -- .../CCShimsMkLet_/module-type-S2/index.html | 5 ----- .../{CCMonomorphicShims_ => CCShims_syntax}/.dummy | 0 dev/containers/CCShims_syntax/index.html | 2 ++ .../CCShims_syntax/module-type-LET/index.html | 2 ++ dev/containers/CCVector/index.html | 2 +- dev/containers/index.html | 2 +- 52 files changed, 33 insertions(+), 109 deletions(-) create mode 100644 dev/containers/CCArray/Floatarray/index.html delete mode 100644 dev/containers/CCMonomorphicShims_/index.html delete mode 100644 dev/containers/CCShimsArrayLabels_/.dummy delete mode 100644 dev/containers/CCShimsArrayLabels_/Floatarray/index.html delete mode 100644 dev/containers/CCShimsArrayLabels_/index.html delete mode 100644 dev/containers/CCShimsArray_/.dummy delete mode 100644 dev/containers/CCShimsArray_/index.html delete mode 100644 dev/containers/CCShimsFormat_/.dummy delete mode 100644 dev/containers/CCShimsFormat_/index.html delete mode 100644 dev/containers/CCShimsFun_/.dummy delete mode 100644 dev/containers/CCShimsFun_/index.html delete mode 100644 dev/containers/CCShimsInt_/.dummy delete mode 100644 dev/containers/CCShimsInt_/index.html delete mode 100644 dev/containers/CCShimsList_/.dummy delete mode 100644 dev/containers/CCShimsList_/index.html delete mode 100644 dev/containers/CCShimsMkLetList_/.dummy delete mode 100644 dev/containers/CCShimsMkLetList_/Make/argument-1-X/index.html delete mode 100644 dev/containers/CCShimsMkLetList_/Make/index.html delete mode 100644 dev/containers/CCShimsMkLetList_/index.html delete mode 100644 dev/containers/CCShimsMkLetList_/module-type-S/index.html delete mode 100644 dev/containers/CCShimsMkLet_/.dummy delete mode 100644 dev/containers/CCShimsMkLet_/Make/argument-1-X/index.html delete mode 100644 dev/containers/CCShimsMkLet_/Make/index.html delete mode 100644 dev/containers/CCShimsMkLet_/Make2/argument-1-X/index.html delete mode 100644 dev/containers/CCShimsMkLet_/Make2/index.html delete mode 100644 dev/containers/CCShimsMkLet_/index.html delete mode 100644 dev/containers/CCShimsMkLet_/module-type-S/index.html delete mode 100644 dev/containers/CCShimsMkLet_/module-type-S2/index.html rename dev/containers/{CCMonomorphicShims_ => CCShims_syntax}/.dummy (100%) create mode 100644 dev/containers/CCShims_syntax/index.html create mode 100644 dev/containers/CCShims_syntax/module-type-LET/index.html diff --git a/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html b/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html index 06bb4559..429c99f2 100644 --- a/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html +++ b/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCMutHeap.Make.1-X)

Parameter Make.1-X

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Index in heap. return -1 if never set

Update index in heap

val lt : t -> t -> bool

Update index in heap

cmp a b is true iff a < b

\ No newline at end of file +X (containers-data.CCMutHeap.Make.1-X)

Parameter Make.1-X

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Update index in heap

val lt : t -> t -> bool

cmp a b is true iff a < b

\ No newline at end of file diff --git a/dev/containers-data/CCMutHeap_intf/module-type-RANKED/index.html b/dev/containers-data/CCMutHeap_intf/module-type-RANKED/index.html index fa522150..ffae0e07 100644 --- a/dev/containers-data/CCMutHeap_intf/module-type-RANKED/index.html +++ b/dev/containers-data/CCMutHeap_intf/module-type-RANKED/index.html @@ -1,2 +1,2 @@ -RANKED (containers-data.CCMutHeap_intf.RANKED)

Module type CCMutHeap_intf.RANKED

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Index in heap. return -1 if never set

Update index in heap

val lt : t -> t -> bool

Update index in heap

cmp a b is true iff a < b

\ No newline at end of file +RANKED (containers-data.CCMutHeap_intf.RANKED)

Module type CCMutHeap_intf.RANKED

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Update index in heap

val lt : t -> t -> bool

cmp a b is true iff a < b

\ No newline at end of file diff --git a/dev/containers-data/CCPersistentArray/index.html b/dev/containers-data/CCPersistentArray/index.html index 6d5b85b4..b3c72b86 100644 --- a/dev/containers-data/CCPersistentArray/index.html +++ b/dev/containers-data/CCPersistentArray/index.html @@ -1,2 +1,2 @@ -CCPersistentArray (containers-data.CCPersistentArray)

Module CCPersistentArray

Persistent Arrays

From the paper by Jean-Christophe Filliâtre, "A persistent Union-Find data structure", see the ps version

type 'a t

The type of persistent arrays

val make : int -> 'a -> 'a t

make n x returns a persistent array of length n, with x. All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one of the array entries will modify all other entries at the same time.

  • raises Invalid_argument

    if n < 0 or n > Sys.max_array_length. If the value of x is a floating-point number, then the maximum size is only Sys.max_array_length / 2.

val init : int -> ( int -> 'a ) -> 'a t

init n f returns a persistent array of length n, with element i initialized to the result of f i.

  • raises Invalid_argument

    if n < 0 or n > Sys.max_array_length. If the value of x is a floating-point number, then the maximum size is only Sys.max_array_length / 2.

val get : 'a t -> int -> 'a

get a i returns the element with index i from the array a.

  • raises Invalid_argument

    "index out of bounds" if n is outside the range 0 to Array.length a - 1.

val set : 'a t -> int -> 'a -> 'a t

set a i v sets the element index i from the array a to v.

  • raises Invalid_argument

    "index out of bounds" if n is outside the range 0 to Array.length a - 1.

val length : 'a t -> int

Return the length of the persistent array.

val copy : 'a t -> 'a t

copy a returns a fresh copy of a. Both copies are independent.

val map : ( 'a -> 'b ) -> 'a t -> 'b t
val mapi : ( int -> 'a -> 'b ) -> 'a t -> 'b t

Apply the given function to all elements of the array, and return a persistent array initialized by the results of f. In the case of mapi, the function is also given the index of the element. It is equivalent to fun f t -> init (fun i -> f (get t i)).

val iter : ( 'a -> unit ) -> 'a t -> unit

iter f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.

val iteri : ( int -> 'a -> unit ) -> 'a t -> unit

iter f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.

val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'a
val fold_right : ( 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b

Fold on the elements of the array.

val append : 'a t -> 'a t -> 'a t

Append the two arrays.

  • since 0.13
val flatten : 'a t t -> 'a t

Concatenates all the sub-arrays.

  • since 0.13
val flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t

Flat map (map + concatenation).

  • since 0.13
val to_array : 'a t -> 'a array

to_array t returns a mutable copy of t.

val of_array : 'a array -> 'a t

of_array a returns an immutable copy of a.

val to_list : 'a t -> 'a list

to_list t returns the list of elements in t.

val of_list : 'a list -> 'a t

of_list l returns a fresh persistent array containing the elements of l.

val of_rev_list : 'a list -> 'a t

of_rev_list l is the same as of_list (List.rev l) but more efficient.

  • since 0.13

Conversions

type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
val to_iter : 'a t -> 'a iter
val of_iter : 'a iter -> 'a t
val of_gen : 'a gen -> 'a t
  • since 0.13
val to_gen : 'a t -> 'a gen
  • since 0.13

IO

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : 'a printer -> 'a t printer
  • since 0.13
\ No newline at end of file +CCPersistentArray (containers-data.CCPersistentArray)

Module CCPersistentArray

Persistent Arrays

From the paper by Jean-Christophe Filliâtre, "A persistent Union-Find data structure", see the ps version

type 'a t

The type of persistent arrays

val make : int -> 'a -> 'a t

make n x returns a persistent array of length n, with x. All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one of the array entries will modify all other entries at the same time.

  • raises Invalid_argument

    if n < 0 or n > Sys.max_array_length. If the value of x is a floating-point number, then the maximum size is only Sys.max_array_length / 2.

val init : int -> ( int -> 'a ) -> 'a t

init n f returns a persistent array of length n, with element i initialized to the result of f i.

  • raises Invalid_argument

    if n < 0 or n > Sys.max_array_length. If the value of x is a floating-point number, then the maximum size is only Sys.max_array_length / 2.

val get : 'a t -> int -> 'a

get a i returns the element with index i from the array a.

  • raises Invalid_argument

    "index out of bounds" if n is outside the range 0 to Array.length a - 1.

val set : 'a t -> int -> 'a -> 'a t

set a i v sets the element index i from the array a to v.

  • raises Invalid_argument

    "index out of bounds" if n is outside the range 0 to Array.length a - 1.

val length : 'a t -> int

Return the length of the persistent array.

val copy : 'a t -> 'a t

copy a returns a fresh copy of a. Both copies are independent.

val map : ( 'a -> 'b ) -> 'a t -> 'b t
val mapi : ( int -> 'a -> 'b ) -> 'a t -> 'b t

Apply the given function to all elements of the array, and return a persistent array initialized by the results of f. In the case of mapi, the function is also given the index of the element. It is equivalent to fun f t -> init (fun i -> f (get t i)).

val iter : ( 'a -> unit ) -> 'a t -> unit

iter f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.

val iteri : ( int -> 'a -> unit ) -> 'a t -> unit
val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'a
val fold_right : ( 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b

Fold on the elements of the array.

val append : 'a t -> 'a t -> 'a t

Append the two arrays.

  • since 0.13
val flatten : 'a t t -> 'a t

Concatenates all the sub-arrays.

  • since 0.13
val flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t

Flat map (map + concatenation).

  • since 0.13
val to_array : 'a t -> 'a array

to_array t returns a mutable copy of t.

val of_array : 'a array -> 'a t

of_array a returns an immutable copy of a.

val to_list : 'a t -> 'a list

to_list t returns the list of elements in t.

val of_list : 'a list -> 'a t

of_list l returns a fresh persistent array containing the elements of l.

val of_rev_list : 'a list -> 'a t

of_rev_list l is the same as of_list (List.rev l) but more efficient.

  • since 0.13

Conversions

type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
val to_iter : 'a t -> 'a iter
val of_iter : 'a iter -> 'a t
val of_gen : 'a gen -> 'a t
  • since 0.13
val to_gen : 'a t -> 'a gen
  • since 0.13

IO

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : 'a printer -> 'a t printer
  • since 0.13
\ No newline at end of file diff --git a/dev/containers-thread/CCPool/Make/Fut/Infix/index.html b/dev/containers-thread/CCPool/Make/Fut/Infix/index.html index 1147054f..813806d4 100644 --- a/dev/containers-thread/CCPool/Make/Fut/Infix/index.html +++ b/dev/containers-thread/CCPool/Make/Fut/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers-thread.CCPool.Make.Fut.Infix)

Module Fut.Infix

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
val (>>) : 'a t -> ( unit -> 'b t ) -> 'b t
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t
val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
include CCShimsMkLet_.S with type 'a t_let := 'a t
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file +Infix (containers-thread.CCPool.Make.Fut.Infix)

Module Fut.Infix

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
val (>>) : 'a t -> ( unit -> 'b t ) -> 'b t
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t
val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
include CCShims_syntax.LET with type 'a t := 'a t
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file diff --git a/dev/containers-thread/CCPool/Make/Fut/index.html b/dev/containers-thread/CCPool/Make/Fut/index.html index c3e784dd..469c5eff 100644 --- a/dev/containers-thread/CCPool/Make/Fut/index.html +++ b/dev/containers-thread/CCPool/Make/Fut/index.html @@ -1,2 +1,2 @@ -Fut (containers-thread.CCPool.Make.Fut)

Module Make.Fut

Futures

The futures are registration points for callbacks, storing a state, that are executed in the pool using run.

type 'a t

A future value of type 'a

type 'a future = 'a t

Constructors

val return : 'a -> 'a t

Future that is already computed.

val fail : exn -> 'a t

Future that fails immediately.

val make : ( unit -> 'a ) -> 'a t

Create a future, representing a value that will be computed by the function. If the function raises, the future will fail.

val make1 : ( 'a -> 'b ) -> 'a -> 'b t
val make2 : ( 'a -> 'b -> 'c ) -> 'a -> 'b -> 'c t

Basics

val get : 'a t -> 'a

Blocking get: wait for the future to be evaluated, and get the value, or the exception that failed the future is returned. Raise e if the future failed with e.

val state : 'a t -> 'a state

State of the future.

val is_done : 'a t -> bool

Is the future evaluated (success/failure)?

Combinators

val on_success : 'a t -> ( 'a -> unit ) -> unit

Attach a handler to be called upon success. The handler should not call functions on the future. Might be evaluated now if the future is already done.

val on_failure : _ t -> ( exn -> unit ) -> unit

Attach a handler to be called upon failure. The handler should not call any function on the future. Might be evaluated now if the future is already done.

val on_finish : 'a t -> ( 'a state -> unit ) -> unit

Attach a handler to be called when the future is evaluated. The handler should not call functions on the future. Might be evaluated now if the future is already done.

val flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t

Monadic combination of futures.

val and_then : 'a t -> ( unit -> 'b t ) -> 'b t

Wait for the first future to succeed, then launch the second.

val sequence_a : 'a t array -> 'a array t

Future that waits for all previous futures to terminate. If any future in the array fails, sequence_a l fails too.

val map_a : ( 'a -> 'b t ) -> 'a array -> 'b array t

map_a f a maps f on every element of a, and will return the array of every result if all calls succeed, or an error otherwise.

val sequence_l : 'a t list -> 'a list t

Future that waits for all previous futures to terminate. If any future in the list fails, sequence_l l fails too.

val map_l : ( 'a -> 'b t ) -> 'a list -> 'b list t

map_l f l maps f on every element of l, and will return the list of every result if all calls succeed, or an error otherwise.

val choose_a : 'a t array -> 'a t

Choose among those futures (the first to terminate). Behaves like the first future that terminates, by failing if the future fails.

val choose_l : 'a t list -> 'a t

Choose among those futures (the first to terminate). Behaves like the first future that terminates, by failing if the future fails.

val map : ( 'a -> 'b ) -> 'a t -> 'b t

Map the value inside the future. The function doesn't run in its own task; if it can take time, use flat_map or map_async.

val map_async : ( 'a -> 'b ) -> 'a t -> 'b t

Map the value inside the future, to be computed in a separated job.

val monoid_product : ( 'a -> 'b -> 'c ) -> 'a t -> 'b t -> 'c t

Cartesian product of the content of these futures.

  • since 2.8
val app : ( 'a -> 'b ) t -> 'a t -> 'b t

app f x applies the result of f to the result of x.

val app_async : ( 'a -> 'b ) t -> 'a t -> 'b t

app_async f x applies the result of f to the result of x, in a separated job scheduled in the pool.

val sleep : float -> unit t

Future that returns with success in the given amount of seconds. Blocks the thread! If you need to wait on many events, consider using CCTimer.

module Infix : sig ... end
val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
val (>>) : 'a t -> ( unit -> 'b t ) -> 'b t
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

Alias to map.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

Alias to app.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
include CCShimsMkLet_.S with type 'a t_let := 'a t
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file +Fut (containers-thread.CCPool.Make.Fut)

Module Make.Fut

Futures

The futures are registration points for callbacks, storing a state, that are executed in the pool using run.

type 'a t

A future value of type 'a

type 'a future = 'a t

Constructors

val return : 'a -> 'a t

Future that is already computed.

val fail : exn -> 'a t

Future that fails immediately.

val make : ( unit -> 'a ) -> 'a t

Create a future, representing a value that will be computed by the function. If the function raises, the future will fail.

val make1 : ( 'a -> 'b ) -> 'a -> 'b t
val make2 : ( 'a -> 'b -> 'c ) -> 'a -> 'b -> 'c t

Basics

val get : 'a t -> 'a

Blocking get: wait for the future to be evaluated, and get the value, or the exception that failed the future is returned. Raise e if the future failed with e.

val state : 'a t -> 'a state

State of the future.

val is_done : 'a t -> bool

Is the future evaluated (success/failure)?

Combinators

val on_success : 'a t -> ( 'a -> unit ) -> unit

Attach a handler to be called upon success. The handler should not call functions on the future. Might be evaluated now if the future is already done.

val on_failure : _ t -> ( exn -> unit ) -> unit

Attach a handler to be called upon failure. The handler should not call any function on the future. Might be evaluated now if the future is already done.

val on_finish : 'a t -> ( 'a state -> unit ) -> unit

Attach a handler to be called when the future is evaluated. The handler should not call functions on the future. Might be evaluated now if the future is already done.

val flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t

Monadic combination of futures.

val and_then : 'a t -> ( unit -> 'b t ) -> 'b t

Wait for the first future to succeed, then launch the second.

val sequence_a : 'a t array -> 'a array t

Future that waits for all previous futures to terminate. If any future in the array fails, sequence_a l fails too.

val map_a : ( 'a -> 'b t ) -> 'a array -> 'b array t

map_a f a maps f on every element of a, and will return the array of every result if all calls succeed, or an error otherwise.

val sequence_l : 'a t list -> 'a list t

Future that waits for all previous futures to terminate. If any future in the list fails, sequence_l l fails too.

val map_l : ( 'a -> 'b t ) -> 'a list -> 'b list t

map_l f l maps f on every element of l, and will return the list of every result if all calls succeed, or an error otherwise.

val choose_a : 'a t array -> 'a t

Choose among those futures (the first to terminate). Behaves like the first future that terminates, by failing if the future fails.

val choose_l : 'a t list -> 'a t

Choose among those futures (the first to terminate). Behaves like the first future that terminates, by failing if the future fails.

val map : ( 'a -> 'b ) -> 'a t -> 'b t

Map the value inside the future. The function doesn't run in its own task; if it can take time, use flat_map or map_async.

val map_async : ( 'a -> 'b ) -> 'a t -> 'b t

Map the value inside the future, to be computed in a separated job.

val monoid_product : ( 'a -> 'b -> 'c ) -> 'a t -> 'b t -> 'c t

Cartesian product of the content of these futures.

  • since 2.8
val app : ( 'a -> 'b ) t -> 'a t -> 'b t

app f x applies the result of f to the result of x.

val app_async : ( 'a -> 'b ) t -> 'a t -> 'b t

app_async f x applies the result of f to the result of x, in a separated job scheduled in the pool.

val sleep : float -> unit t

Future that returns with success in the given amount of seconds. Blocks the thread! If you need to wait on many events, consider using CCTimer.

module Infix : sig ... end
include module type of Infix
val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
val (>>) : 'a t -> ( unit -> 'b t ) -> 'b t
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t
val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
include CCShims_syntax.LET with type 'a t := 'a t
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file diff --git a/dev/containers/CCArray/Floatarray/index.html b/dev/containers/CCArray/Floatarray/index.html new file mode 100644 index 00000000..598fd2b0 --- /dev/null +++ b/dev/containers/CCArray/Floatarray/index.html @@ -0,0 +1,2 @@ + +Floatarray (containers.CCArray.Floatarray)

Module CCArray.Floatarray

val create : int -> floatarray
val length : floatarray -> int
val get : floatarray -> int -> float
val set : floatarray -> int -> float -> unit
val unsafe_get : floatarray -> int -> float
val unsafe_set : floatarray -> int -> float -> unit
\ No newline at end of file diff --git a/dev/containers/CCArray/index.html b/dev/containers/CCArray/index.html index ba5353c4..3e658b66 100644 --- a/dev/containers/CCArray/index.html +++ b/dev/containers/CCArray/index.html @@ -1,5 +1,5 @@ -CCArray (containers.CCArray)

Module CCArray

Array utils

type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Arrays

include module type of struct include Stdlib.Array end
type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> ( int -> 'a ) -> 'a array
val make_matrix : int -> int -> 'a -> 'a array array
val create_matrix : int -> int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> int -> int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> int -> int -> 'a -> unit
val blit : 'a array -> int -> 'a array -> int -> int -> unit
val to_list : 'a array -> 'a list
val of_list : 'a list -> 'a array
val iter : ( 'a -> unit ) -> 'a array -> unit
val iteri : ( int -> 'a -> unit ) -> 'a array -> unit
val map : ( 'a -> 'b ) -> 'a array -> 'b array
val mapi : ( int -> 'a -> 'b ) -> 'a array -> 'b array
val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b array -> 'a
val fold_left_map : ( 'a -> 'b -> 'a * 'c ) -> 'a -> 'b array -> 'a * 'c array
val fold_right : ( 'b -> 'a -> 'a ) -> 'b array -> 'a -> 'a
val iter2 : ( 'a -> 'b -> unit ) -> 'a array -> 'b array -> unit
val map2 : ( 'a -> 'b -> 'c ) -> 'a array -> 'b array -> 'c array
val for_all : ( 'a -> bool ) -> 'a array -> bool
val exists : ( 'a -> bool ) -> 'a array -> bool
val memq : 'a -> 'a array -> bool
val find_opt : ( 'a -> bool ) -> 'a array -> 'a option
val split : ('a * 'b) array -> 'a array * 'b array
val combine : 'a array -> 'b array -> ('a * 'b) array
val sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val stable_sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val fast_sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray = Stdlib__Array.Floatarray
val empty : 'a t

empty is the empty array, physically equal to [||].

val equal : 'a equal -> 'a t equal

equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.

val compare : 'a ord -> 'a t ord

compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.

val swap : 'a t -> int -> int -> unit

swap a i j swaps elements at indices i and j.

  • since 1.4
val get_safe : 'a t -> int -> 'a option

get_safe a i returns Some a.(i) if i is a valid index.

  • since 0.18
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'a

fold f init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as Array.fold_left

val foldi : ( 'a -> int -> 'b -> 'a ) -> 'a -> 'b t -> 'a

foldi f init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.

val fold_while : ( 'a -> 'b -> 'a * [ `Stop | `Continue ] ) -> 'a -> 'b t -> 'a

fold_while f init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.

  • since 0.8
val fold_map : ( 'acc -> 'a -> 'acc * 'b ) -> 'acc -> 'a t -> 'acc * 'b t

fold_map f init a is a fold_left-like function, but it also maps the array to another array.

  • since 1.2, but only
  • since 2.1 with labels
val scan_left : ( 'acc -> 'a -> 'acc ) -> 'acc -> 'a t -> 'acc t

scan_left f init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .

  • since 1.2, but only
  • since 2.1 with labels
val reverse_in_place : 'a t -> unit

reverse_in_place a reverses the array a in place.

val sorted : ( 'a -> 'a -> int ) -> 'a t -> 'a array

sorted f a makes a copy of a and sorts it with f.

  • since 1.0
val sort_indices : ( 'a -> 'a -> int ) -> 'a t -> int array

sort_indices f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.

In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.

  • since 1.0
val sort_ranking : ( 'a -> 'a -> int ) -> 'a t -> int array

sort_ranking f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.

In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.

In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).

  • since 1.0
val mem : ?eq:( 'a -> 'a -> bool ) -> 'a -> 'a t -> bool

mem ~eq x a return true if x is present in a. Linear time.

  • since 3.0
val find_map : ( 'a -> 'b option ) -> 'a t -> 'b option

find_map f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.

  • since 1.3, but only
  • since 2.1 with labels
val find_map_i : ( int -> 'a -> 'b option ) -> 'a t -> 'b option

find_map_i f a is like find_map, but the index of the element is also passed to the predicate function f.

  • since 1.3, but only
  • since 2.1 with labels
val find_idx : ( 'a -> bool ) -> 'a t -> (int * 'a) option

find_idx f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.

  • since 0.3.4
val lookup : cmp:'a ord -> 'a -> 'a t -> int option

lookup ~cmp key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt ~cmp. Complexity: O(log (n)) (dichotomic search).

  • returns

    None if the key key is not present, or Some i (i the index of the key) otherwise.

val lookup_exn : cmp:'a ord -> 'a -> 'a t -> int

lookup_exn ~cmp key a is like lookup, but

  • raises Not_found

    if the key key is not present.

val bsearch : +CCArray (containers.CCArray)

Module CCArray

Array utils

type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Arrays

type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> ( int -> 'a ) -> 'a array
val make_matrix : int -> int -> 'a -> 'a array array
val create_matrix : int -> int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> int -> int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> int -> int -> 'a -> unit
val blit : 'a array -> int -> 'a array -> int -> int -> unit
val to_list : 'a array -> 'a list
val of_list : 'a list -> 'a array
val iter : ( 'a -> unit ) -> 'a array -> unit
val iteri : ( int -> 'a -> unit ) -> 'a array -> unit
val map : ( 'a -> 'b ) -> 'a array -> 'b array
val mapi : ( int -> 'a -> 'b ) -> 'a array -> 'b array
val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b array -> 'a
val fold_left_map : ( 'a -> 'b -> 'a * 'c ) -> 'a -> 'b array -> 'a * 'c array
val fold_right : ( 'b -> 'a -> 'a ) -> 'b array -> 'a -> 'a
val iter2 : ( 'a -> 'b -> unit ) -> 'a array -> 'b array -> unit
val map2 : ( 'a -> 'b -> 'c ) -> 'a array -> 'b array -> 'c array
val for_all : ( 'a -> bool ) -> 'a array -> bool
val exists : ( 'a -> bool ) -> 'a array -> bool
val memq : 'a -> 'a array -> bool
val find_opt : ( 'a -> bool ) -> 'a array -> 'a option
val split : ('a * 'b) array -> 'a array * 'b array
val combine : 'a array -> 'b array -> ('a * 'b) array
val sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val stable_sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val fast_sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray : sig ... end
val empty : 'a t

empty is the empty array, physically equal to [||].

val equal : 'a equal -> 'a t equal

equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.

val compare : 'a ord -> 'a t ord

compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.

val swap : 'a t -> int -> int -> unit

swap a i j swaps elements at indices i and j.

  • since 1.4
val get_safe : 'a t -> int -> 'a option

get_safe a i returns Some a.(i) if i is a valid index.

  • since 0.18
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'a

fold f init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as Array.fold_left

val foldi : ( 'a -> int -> 'b -> 'a ) -> 'a -> 'b t -> 'a

foldi f init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.

val fold_while : ( 'a -> 'b -> 'a * [ `Stop | `Continue ] ) -> 'a -> 'b t -> 'a

fold_while f init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.

  • since 0.8
val fold_map : ( 'acc -> 'a -> 'acc * 'b ) -> 'acc -> 'a t -> 'acc * 'b t

fold_map f init a is a fold_left-like function, but it also maps the array to another array.

  • since 1.2, but only
  • since 2.1 with labels
val scan_left : ( 'acc -> 'a -> 'acc ) -> 'acc -> 'a t -> 'acc t

scan_left f init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .

  • since 1.2, but only
  • since 2.1 with labels
val reverse_in_place : 'a t -> unit

reverse_in_place a reverses the array a in place.

val sorted : ( 'a -> 'a -> int ) -> 'a t -> 'a array

sorted f a makes a copy of a and sorts it with f.

  • since 1.0
val sort_indices : ( 'a -> 'a -> int ) -> 'a t -> int array

sort_indices f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.

In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.

  • since 1.0
val sort_ranking : ( 'a -> 'a -> int ) -> 'a t -> int array

sort_ranking f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.

In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.

In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).

  • since 1.0
val mem : ?eq:( 'a -> 'a -> bool ) -> 'a -> 'a t -> bool

mem ~eq x a return true if x is present in a. Linear time.

  • since 3.0
val find_map : ( 'a -> 'b option ) -> 'a t -> 'b option

find_map f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.

  • since 1.3, but only
  • since 2.1 with labels
val find_map_i : ( int -> 'a -> 'b option ) -> 'a t -> 'b option

find_map_i f a is like find_map, but the index of the element is also passed to the predicate function f.

  • since 1.3, but only
  • since 2.1 with labels
val find_idx : ( 'a -> bool ) -> 'a t -> (int * 'a) option

find_idx f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.

  • since 0.3.4
val lookup : cmp:'a ord -> 'a -> 'a t -> int option

lookup ~cmp key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt ~cmp. Complexity: O(log (n)) (dichotomic search).

  • returns

    None if the key key is not present, or Some i (i the index of the key) otherwise.

val lookup_exn : cmp:'a ord -> 'a -> 'a t -> int

lookup_exn ~cmp key a is like lookup, but

  • raises Not_found

    if the key key is not present.

val bsearch : cmp:( 'a -> 'a -> int ) -> 'a -> 'a t -> diff --git a/dev/containers/CCArrayLabels/index.html b/dev/containers/CCArrayLabels/index.html index 8d9732bc..7fdd4280 100644 --- a/dev/containers/CCArrayLabels/index.html +++ b/dev/containers/CCArrayLabels/index.html @@ -1,6 +1,5 @@ -CCArrayLabels (containers.CCArrayLabels)

Module CCArrayLabels

Array utils (Labeled version of CCArray)

type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Arrays

include module type of Stdlib.ArrayLabels - with module Floatarray = Stdlib.Array.Floatarray
type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> f:( int -> 'a ) -> 'a array
val make_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val create_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> pos:int -> len:int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> pos:int -> len:int -> 'a -> unit
val blit : +CCArrayLabels (containers.CCArrayLabels)

Module CCArrayLabels

Array utils (Labeled version of CCArray)

type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Arrays

type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> f:( int -> 'a ) -> 'a array
val make_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val create_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> pos:int -> len:int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> pos:int -> len:int -> 'a -> unit
val blit : src:'a array -> src_pos:int -> dst:'a array -> @@ -10,7 +9,7 @@ f:( 'a -> 'b -> 'a * 'c ) -> init:'a -> 'b array -> - 'a * 'c array
val fold_right : f:( 'b -> 'a -> 'a ) -> 'b array -> init:'a -> 'a
val for_all : f:( 'a -> bool ) -> 'a array -> bool
val exists : f:( 'a -> bool ) -> 'a array -> bool
val memq : 'a -> set:'a array -> bool
val find_opt : f:( 'a -> bool ) -> 'a array -> 'a option
val split : ('a * 'b) array -> 'a array * 'b array
val combine : 'a array -> 'b array -> ('a * 'b) array
val sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val stable_sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val fast_sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray : sig ... end
val empty : 'a t

empty is the empty array, physically equal to ||.

val equal : 'a equal -> 'a t equal

equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.

val compare : 'a ord -> 'a t ord

compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.

val swap : 'a t -> int -> int -> unit

swap a i j swaps elements at indices i and j.

  • since 1.4
val get_safe : 'a t -> int -> 'a option

get_safe a i returns Some a.(i) if i is a valid index.

  • since 0.18
val fold : f:( 'a -> 'b -> 'a ) -> init:'a -> 'b t -> 'a

fold ~f ~init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as ArrayLabels.fold_left

val foldi : f:( 'a -> int -> 'b -> 'a ) -> init:'a -> 'b t -> 'a

foldi ~f ~init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.

val fold_while : + 'a * 'c array
val fold_right : f:( 'b -> 'a -> 'a ) -> 'b array -> init:'a -> 'a
val for_all : f:( 'a -> bool ) -> 'a array -> bool
val exists : f:( 'a -> bool ) -> 'a array -> bool
val memq : 'a -> set:'a array -> bool
val find_opt : f:( 'a -> bool ) -> 'a array -> 'a option
val split : ('a * 'b) array -> 'a array * 'b array
val combine : 'a array -> 'b array -> ('a * 'b) array
val sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val stable_sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val fast_sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray : sig ... end
val empty : 'a t

empty is the empty array, physically equal to ||.

val equal : 'a equal -> 'a t equal

equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.

val compare : 'a ord -> 'a t ord

compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.

val swap : 'a t -> int -> int -> unit

swap a i j swaps elements at indices i and j.

  • since 1.4
val get_safe : 'a t -> int -> 'a option

get_safe a i returns Some a.(i) if i is a valid index.

  • since 0.18
val fold : f:( 'a -> 'b -> 'a ) -> init:'a -> 'b t -> 'a

fold ~f ~init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as ArrayLabels.fold_left

val foldi : f:( 'a -> int -> 'b -> 'a ) -> init:'a -> 'b t -> 'a

foldi ~f ~init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.

val fold_while : f:( 'a -> 'b -> 'a * [ `Stop | `Continue ] ) -> init:'a -> 'b t -> diff --git a/dev/containers/CCFun/index.html b/dev/containers/CCFun/index.html index bd318215..bdd28b42 100644 --- a/dev/containers/CCFun/index.html +++ b/dev/containers/CCFun/index.html @@ -1,5 +1,5 @@ -CCFun (containers.CCFun)

Module CCFun

Basic operations on Functions

include module type of Stdlib.Fun
val id : 'a -> 'a
val const : 'a -> 'b -> 'a
val flip : ( 'a -> 'b -> 'c ) -> 'b -> 'a -> 'c
val negate : ( 'a -> bool ) -> 'a -> bool
val protect : finally:( unit -> unit ) -> ( unit -> 'a ) -> 'a
exception Finally_raised of exn
val compose : ( 'a -> 'b ) -> ( 'b -> 'c ) -> 'a -> 'c

compose f g x is g (f x). Composition.

val compose_binop : ( 'a -> 'b ) -> ( 'b -> 'b -> 'c ) -> 'a -> 'a -> 'c

compose_binop f g is fun x y -> g (f x) (f y). Example (partial order): List.sort (compose_binop fst CCInt.compare) [1, true; 2, false; 1, false].

  • since 0.6
val curry : ( ('a * 'b) -> 'c ) -> 'a -> 'b -> 'c

curry f x y is f (x,y). Convert a function which accepts a pair of arguments into a function which accepts two arguments.

val uncurry : ( 'a -> 'b -> 'c ) -> ('a * 'b) -> 'c

uncurry f (x,y) is f x y. Convert a function which accepts a two arguments into a function which accepts a pair of arguments.

val tap : ( 'a -> _ ) -> 'a -> 'a

tap f x evaluates f x, discards it, then returns x. Useful in a pipeline, for instance:

CCArray.(1 -- 10)
+CCFun (containers.CCFun)

Module CCFun

Basic operations on Functions

val id : 'a -> 'a
val const : 'a -> 'b -> 'a
val flip : ( 'a -> 'b -> 'c ) -> 'b -> 'a -> 'c
val negate : ( 'a -> bool ) -> 'a -> bool
val protect : finally:( unit -> unit ) -> ( unit -> 'a ) -> 'a
exception Finally_raised of exn
val compose : ( 'a -> 'b ) -> ( 'b -> 'c ) -> 'a -> 'c

compose f g x is g (f x). Composition.

val compose_binop : ( 'a -> 'b ) -> ( 'b -> 'b -> 'c ) -> 'a -> 'a -> 'c

compose_binop f g is fun x y -> g (f x) (f y). Example (partial order): List.sort (compose_binop fst CCInt.compare) [1, true; 2, false; 1, false].

  • since 0.6
val curry : ( ('a * 'b) -> 'c ) -> 'a -> 'b -> 'c

curry f x y is f (x,y). Convert a function which accepts a pair of arguments into a function which accepts two arguments.

val uncurry : ( 'a -> 'b -> 'c ) -> ('a * 'b) -> 'c

uncurry f (x,y) is f x y. Convert a function which accepts a two arguments into a function which accepts a pair of arguments.

val tap : ( 'a -> _ ) -> 'a -> 'a

tap f x evaluates f x, discards it, then returns x. Useful in a pipeline, for instance:

CCArray.(1 -- 10)
 |> tap CCArray.shuffle
 |> tap @@ CCArray.sort Stdlib.compare
val lexicographic : ( 'a -> 'a -> int ) -> diff --git a/dev/containers/CCInt/index.html b/dev/containers/CCInt/index.html index 5b77de3b..25ada972 100644 --- a/dev/containers/CCInt/index.html +++ b/dev/containers/CCInt/index.html @@ -1,2 +1,2 @@ -CCInt (containers.CCInt)

Module CCInt

Basic Int functions

include module type of struct include Stdlib.Int end
type t = int
val zero : t

zero is the integer 0.

  • since 3.0
val one : t

one is the integer 1.

  • since 3.0
val minus_one : t

minus_one is the integer -1.

  • since 3.0
val add : t -> t -> t

add x y is x + y.

  • since 3.0
val sub : t -> t -> t

sub x y is x - y.

  • since 3.0
val mul : t -> t -> t

mul x y is x * y.

  • since 3.0
val div : t -> t -> t

div x y is x / y

  • since 3.0
val succ : t -> t

succ x is x + 1.

  • since 3.0
val pred : t -> t

pred x is x - 1.

  • since 3.0
val abs : t -> t

abs x is the absolute value of x. It is x if x is positive and neg x otherwise.

  • since 3.0
val max_int : t

max_int is the maximum integer.

  • since 3.0
val min_int : t

min_int is the minimum integer.

  • since 3.0
val compare : t -> t -> int

compare x y is the comparison function for integers with the same specification as Stdlib.compare.

val equal : t -> t -> bool

equal x y is true iff x and y are equal. Equality function for integers.

val hash : t -> int

hash x computes the hash of x.

val sign : t -> int

sign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x 0.

val neg : t -> t

neg x is - x. Unary negation.

  • since 0.5
val pow : t -> t -> t

pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.

  • since 0.11
val floor_div : t -> t -> t

floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.

  • since 1.2
val rem : t -> t -> t

rem x n is the remainder of dividing x by n, with the same sign as n.

  • since 1.2
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val random : int -> t random_gen
val random_small : t random_gen
val random_range : int -> int -> t random_gen
val pp : t printer

pp ppf x prints the integer x on ppf.

val to_float : t -> float

to_float is the same as float_of_int

  • since 3.0
val to_string : t -> string

to_string x returns the string representation of the integer x, in signed decimal.

  • since 0.13
val of_string : string -> t option

of_string s converts the given string s into an integer. Safe version of of_string_exn.

  • since 0.13
val of_string_exn : string -> t

of_string_exn s converts the given string s to an integer. Alias to int_of_string.

  • raises Failure

    in case of failure.

  • since 3.0
val of_float : float -> t

of_float x converts the given floating-point number x to an integer. Alias to int_of_float.

  • since 3.0
val pp_binary : t printer

pp_binary ppf x prints x on ppf. Print as "0b00101010".

  • since 0.20
val to_string_binary : t -> string

to_string_binary x returns the string representation of the integer x, in binary.

  • since 0.20
val min : t -> t -> t

min x y returns the minimum of the two integers x and y.

  • since 0.17
val max : t -> t -> t

max x y returns the maximum of the two integers x and y.

  • since 0.17
val range_by : step:t -> t -> t -> t iter

range_by ~step i j iterates on integers from i to j included, where the difference between successive elements is step. Use a negative step for a decreasing list.

  • raises Invalid_argument

    if step=0.

  • since 1.2
val range : t -> t -> t iter

range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.

  • since 1.2
val range' : t -> t -> t iter

range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].

  • since 1.2
val popcount : t -> int

Number of bits set to 1

  • since 3.0
val logand : t -> t -> t

logand is the same as (land).

  • since 3.0
val logor : t -> t -> t

logand is the same as (lor).

  • since 3.0
val logxor : t -> t -> t

logxor is the same as (lxor).

  • since 3.0
val lognot : t -> t

logand is the same as lnot.

  • since 3.0
val shift_left : t -> int -> t

shift_left is the same as (lsl).

  • since 3.0
val shift_right : t -> int -> t

shift_right is the same as (asr).

  • since 3.0
val shift_right_logical : t -> int -> t

shift_right_logical is the same as (lsr).

  • since 3.0

Infix Operators

  • since 0.17
module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 0.17
val (<>) : t -> t -> bool
  • since 0.17
val (<) : t -> t -> bool
  • since 0.17
val (>) : t -> t -> bool
  • since 0.17
val (<=) : t -> t -> bool
  • since 0.17
val (>=) : t -> t -> bool
  • since 0.17
val (--) : t -> t -> t iter

Alias to range.

  • since 1.2
val (--^) : t -> t -> t iter

Alias to range'.

  • since 1.2
val (+) : t -> t -> t
  • since 2.1
val (-) : t -> t -> t
  • since 2.1
val (~-) : t -> t
  • since 2.1
val (*) : t -> t -> t
  • since 2.1
val (/) : t -> t -> t
  • since 2.1
val (**) : t -> t -> t
  • since 2.4
val (mod) : t -> t -> t
  • since 2.1
val (land) : t -> t -> t
  • since 2.1
val (lor) : t -> t -> t
  • since 2.1
val (lxor) : t -> t -> t
  • since 2.1
val lnot : t -> t
  • since 2.1
val (lsl) : t -> int -> t
  • since 2.1
val (lsr) : t -> int -> t
  • since 2.1
val (asr) : t -> int -> t
  • since 2.1
\ No newline at end of file +CCInt (containers.CCInt)

Module CCInt

Basic Int functions

type t = int
val zero : t

zero is the integer 0.

  • since 3.0
val one : t

one is the integer 1.

  • since 3.0
val minus_one : t

minus_one is the integer -1.

  • since 3.0
val add : t -> t -> t

add x y is x + y.

  • since 3.0
val sub : t -> t -> t

sub x y is x - y.

  • since 3.0
val mul : t -> t -> t

mul x y is x * y.

  • since 3.0
val div : t -> t -> t

div x y is x / y

  • since 3.0
val succ : t -> t

succ x is x + 1.

  • since 3.0
val pred : t -> t

pred x is x - 1.

  • since 3.0
val abs : t -> t

abs x is the absolute value of x. It is x if x is positive and neg x otherwise.

  • since 3.0
val max_int : t

max_int is the maximum integer.

  • since 3.0
val min_int : t

min_int is the minimum integer.

  • since 3.0
val compare : t -> t -> int

compare x y is the comparison function for integers with the same specification as Stdlib.compare.

val equal : t -> t -> bool

equal x y is true iff x and y are equal. Equality function for integers.

val hash : t -> int

hash x computes the hash of x.

val sign : t -> int

sign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x 0.

val neg : t -> t

neg x is - x. Unary negation.

  • since 0.5
val pow : t -> t -> t

pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.

  • since 0.11
val floor_div : t -> t -> t

floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.

  • since 1.2
val rem : t -> t -> t

rem x n is the remainder of dividing x by n, with the same sign as n.

  • since 1.2
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val random : int -> t random_gen
val random_small : t random_gen
val random_range : int -> int -> t random_gen
val pp : t printer

pp ppf x prints the integer x on ppf.

val to_float : t -> float

to_float is the same as float_of_int

  • since 3.0
val to_string : t -> string

to_string x returns the string representation of the integer x, in signed decimal.

  • since 0.13
val of_string : string -> t option

of_string s converts the given string s into an integer. Safe version of of_string_exn.

  • since 0.13
val of_string_exn : string -> t

of_string_exn s converts the given string s to an integer. Alias to int_of_string.

  • raises Failure

    in case of failure.

  • since 3.0
val of_float : float -> t

of_float x converts the given floating-point number x to an integer. Alias to int_of_float.

  • since 3.0
val pp_binary : t printer

pp_binary ppf x prints x on ppf. Print as "0b00101010".

  • since 0.20
val to_string_binary : t -> string

to_string_binary x returns the string representation of the integer x, in binary.

  • since 0.20
val min : t -> t -> t

min x y returns the minimum of the two integers x and y.

  • since 0.17
val max : t -> t -> t

max x y returns the maximum of the two integers x and y.

  • since 0.17
val range_by : step:t -> t -> t -> t iter

range_by ~step i j iterates on integers from i to j included, where the difference between successive elements is step. Use a negative step for a decreasing list.

  • raises Invalid_argument

    if step=0.

  • since 1.2
val range : t -> t -> t iter

range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.

  • since 1.2
val range' : t -> t -> t iter

range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].

  • since 1.2
val popcount : t -> int

Number of bits set to 1

  • since 3.0
val logand : t -> t -> t

logand is the same as (land).

  • since 3.0
val logor : t -> t -> t

logand is the same as (lor).

  • since 3.0
val logxor : t -> t -> t

logxor is the same as (lxor).

  • since 3.0
val lognot : t -> t

logand is the same as lnot.

  • since 3.0
val shift_left : t -> int -> t

shift_left is the same as (lsl).

  • since 3.0
val shift_right : t -> int -> t

shift_right is the same as (asr).

  • since 3.0
val shift_right_logical : t -> int -> t

shift_right_logical is the same as (lsr).

  • since 3.0

Infix Operators

  • since 0.17
module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 0.17
val (<>) : t -> t -> bool
  • since 0.17
val (<) : t -> t -> bool
  • since 0.17
val (>) : t -> t -> bool
  • since 0.17
val (<=) : t -> t -> bool
  • since 0.17
val (>=) : t -> t -> bool
  • since 0.17
val (--) : t -> t -> t iter

Alias to range.

  • since 1.2
val (--^) : t -> t -> t iter

Alias to range'.

  • since 1.2
val (+) : t -> t -> t
  • since 2.1
val (-) : t -> t -> t
  • since 2.1
val (~-) : t -> t
  • since 2.1
val (*) : t -> t -> t
  • since 2.1
val (/) : t -> t -> t
  • since 2.1
val (**) : t -> t -> t
  • since 2.4
val (mod) : t -> t -> t
  • since 2.1
val (land) : t -> t -> t
  • since 2.1
val (lor) : t -> t -> t
  • since 2.1
val (lxor) : t -> t -> t
  • since 2.1
val lnot : t -> t
  • since 2.1
val (lsl) : t -> int -> t
  • since 2.1
val (lsr) : t -> int -> t
  • since 2.1
val (asr) : t -> int -> t
  • since 2.1
\ No newline at end of file diff --git a/dev/containers/CCList/Infix/index.html b/dev/containers/CCList/Infix/index.html index 021985cd..12311d03 100644 --- a/dev/containers/CCList/Infix/index.html +++ b/dev/containers/CCList/Infix/index.html @@ -1,9 +1,9 @@ -Infix (containers.CCList.Infix)

Module CCList.Infix

val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a t -> 'a t -> 'a t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> l is like map.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

l >>= f is flat_map f l.

val (--) : int -> int -> int t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a list -> ( 'a -> 'b ) -> 'b list
val and+ : 'a list -> 'b list -> ('a * 'b) list
val let* : 'a list -> ( 'a -> 'b list ) -> 'b list
val and* : 'a list -> 'b list -> ('a * 'b) list
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
+Infix (containers.CCList.Infix)

Module CCList.Infix

val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a t -> 'a t -> 'a t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> l is like map.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

l >>= f is flat_map f l.

val (--) : int -> int -> int t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
     let+ x = xs
     and& y = ys
     and& z = zs in
     x + y + z;;
 val f : int list -> int list -> int list -> int list = <fun>
 # f [1;2] [5;6;7] [10;10];;
-- : int list = [16; 18]
  • since 3.1
\ No newline at end of file +- : int list = [16; 18]
  • since 3.1
\ No newline at end of file diff --git a/dev/containers/CCList/index.html b/dev/containers/CCList/index.html index b3afd469..726d4dc4 100644 --- a/dev/containers/CCList/index.html +++ b/dev/containers/CCList/index.html @@ -1,5 +1,5 @@ -CCList (containers.CCList)

Module CCList

Complements to List

type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
include module type of Stdlib.List
val length : 'a list -> int
val cons : 'a -> 'a list -> 'a list
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val rev : 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val iter : ( 'a -> unit ) -> 'a list -> unit
val rev_map : ( 'a -> 'b ) -> 'a list -> 'b list
val concat_map : ( 'a -> 'b list ) -> 'a list -> 'b list
val fold_left_map : ( 'a -> 'b -> 'a * 'c ) -> 'a -> 'b list -> 'a * 'c list
val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b list -> 'a
val iter2 : ( 'a -> 'b -> unit ) -> 'a list -> 'b list -> unit
val map2 : ( 'a -> 'b -> 'c ) -> 'a list -> 'b list -> 'c list
val rev_map2 : ( 'a -> 'b -> 'c ) -> 'a list -> 'b list -> 'c list
val fold_left2 : ( 'a -> 'b -> 'c -> 'a ) -> 'a -> 'b list -> 'c list -> 'a
val fold_right2 : ( 'a -> 'b -> 'c -> 'c ) -> 'a list -> 'b list -> 'c -> 'c
val for_all : ( 'a -> bool ) -> 'a list -> bool
val exists : ( 'a -> bool ) -> 'a list -> bool
val for_all2 : ( 'a -> 'b -> bool ) -> 'a list -> 'b list -> bool
val exists2 : ( 'a -> 'b -> bool ) -> 'a list -> 'b list -> bool
val memq : 'a -> 'a list -> bool
val find : ( 'a -> bool ) -> 'a list -> 'a
val find_all : ( 'a -> bool ) -> 'a list -> 'a list
val filteri : ( int -> 'a -> bool ) -> 'a list -> 'a list
val partition : ( 'a -> bool ) -> 'a list -> 'a list * 'a list
val assq : 'a -> ('a * 'b) list -> 'b
val mem_assq : 'a -> ('a * 'b) list -> bool
val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
val sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val stable_sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val fast_sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val merge : ( 'a -> 'a -> int ) -> 'a list -> 'a list -> 'a list
type 'a t = 'a list
val empty : 'a t

empty is [].

val is_empty : _ t -> bool

is_empty l returns true iff l = [].

  • since 0.11
val map : ( 'a -> 'b ) -> 'a t -> 'b t

map f [a0; a1; …; an] applies function f in turn to a0; a1; …; an. Safe version of List.map.

val append : 'a t -> 'a t -> 'a t

append l1 l2 returns the list that is the concatenation of l1 and l2. Safe version of List.append.

val cons_maybe : 'a option -> 'a t -> 'a t

cons_maybe (Some x) l is x :: l. cons_maybe None l is l.

  • since 0.13
val cons' : 'a t -> 'a -> 'a t

cons' l x is the same as x :: l. This is convenient for fold functions such as List.fold_left or Array.fold_left.

  • since 3.3
val filter : ( 'a -> bool ) -> 'a t -> 'a t

filter p l returns all the elements of the list l that satisfy the predicate p. The order of the elements in the input list l is preserved. Safe version of List.filter.

val fold_right : ( 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b

fold_right f [a1; …; an] b is f a1 (f a2 ( … (f an b) … )). Safe version of List.fold_right.

val fold_while : ( 'a -> 'b -> 'a * [ `Stop | `Continue ] ) -> 'a -> 'b t -> 'a

fold_while f init l folds until a stop condition via ('a, `Stop) is indicated by the accumulator.

  • since 0.8
val fold_map : ( 'acc -> 'a -> 'acc * 'b ) -> 'acc -> 'a list -> 'acc * 'b list

fold_map f init l is a fold_left-like function, but it also maps the list to another list.

  • since 0.14
val fold_map_i : +CCList (containers.CCList)

Module CCList

Complements to List

type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val length : 'a list -> int
val cons : 'a -> 'a list -> 'a list
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val rev : 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val iter : ( 'a -> unit ) -> 'a list -> unit
val rev_map : ( 'a -> 'b ) -> 'a list -> 'b list
val concat_map : ( 'a -> 'b list ) -> 'a list -> 'b list
val fold_left_map : ( 'a -> 'b -> 'a * 'c ) -> 'a -> 'b list -> 'a * 'c list
val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b list -> 'a
val iter2 : ( 'a -> 'b -> unit ) -> 'a list -> 'b list -> unit
val map2 : ( 'a -> 'b -> 'c ) -> 'a list -> 'b list -> 'c list
val rev_map2 : ( 'a -> 'b -> 'c ) -> 'a list -> 'b list -> 'c list
val fold_left2 : ( 'a -> 'b -> 'c -> 'a ) -> 'a -> 'b list -> 'c list -> 'a
val fold_right2 : ( 'a -> 'b -> 'c -> 'c ) -> 'a list -> 'b list -> 'c -> 'c
val for_all : ( 'a -> bool ) -> 'a list -> bool
val exists : ( 'a -> bool ) -> 'a list -> bool
val for_all2 : ( 'a -> 'b -> bool ) -> 'a list -> 'b list -> bool
val exists2 : ( 'a -> 'b -> bool ) -> 'a list -> 'b list -> bool
val memq : 'a -> 'a list -> bool
val find : ( 'a -> bool ) -> 'a list -> 'a
val find_all : ( 'a -> bool ) -> 'a list -> 'a list
val filteri : ( int -> 'a -> bool ) -> 'a list -> 'a list
val partition : ( 'a -> bool ) -> 'a list -> 'a list * 'a list
val assq : 'a -> ('a * 'b) list -> 'b
val mem_assq : 'a -> ('a * 'b) list -> bool
val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
val sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val stable_sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val fast_sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val merge : ( 'a -> 'a -> int ) -> 'a list -> 'a list -> 'a list
type +'a t = 'a list
val empty : 'a t

empty is [].

val is_empty : _ t -> bool

is_empty l returns true iff l = [].

  • since 0.11
val map : ( 'a -> 'b ) -> 'a t -> 'b t

map f [a0; a1; …; an] applies function f in turn to a0; a1; …; an. Safe version of List.map.

val append : 'a t -> 'a t -> 'a t

append l1 l2 returns the list that is the concatenation of l1 and l2. Safe version of List.append.

val cons_maybe : 'a option -> 'a t -> 'a t

cons_maybe (Some x) l is x :: l. cons_maybe None l is l.

  • since 0.13
val cons' : 'a t -> 'a -> 'a t

cons' l x is the same as x :: l. This is convenient for fold functions such as List.fold_left or Array.fold_left.

  • since 3.3
val filter : ( 'a -> bool ) -> 'a t -> 'a t

filter p l returns all the elements of the list l that satisfy the predicate p. The order of the elements in the input list l is preserved. Safe version of List.filter.

val fold_right : ( 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b

fold_right f [a1; …; an] b is f a1 (f a2 ( … (f an b) … )). Safe version of List.fold_right.

val fold_while : ( 'a -> 'b -> 'a * [ `Stop | `Continue ] ) -> 'a -> 'b t -> 'a

fold_while f init l folds until a stop condition via ('a, `Stop) is indicated by the accumulator.

  • since 0.8
val fold_map : ( 'acc -> 'a -> 'acc * 'b ) -> 'acc -> 'a list -> 'acc * 'b list

fold_map f init l is a fold_left-like function, but it also maps the list to another list.

  • since 0.14
val fold_map_i : ( 'acc -> int -> 'a -> 'acc * 'b ) -> 'acc -> 'a list -> @@ -99,14 +99,14 @@ val square_even : int list -> int list = <fun> ?sep:string -> ( 'a -> string ) -> 'a t -> - string

to_string ?start ?stop ?sep item_to_string l prints l to a string using sep as a separator between elements of l.

  • since 2.7
val to_iter : 'a t -> 'a iter

to_iter l returns a iter of the elements of the list l.

  • since 2.8
val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq l returns a Seq.t of the elements of the list l. Renamed from to_std_seq since 3.0.

  • since 3.0
val of_iter : 'a iter -> 'a t

of_iter iter builds a list from a given iter. In the result, elements appear in the same order as they did in the source iter.

  • since 2.8
val of_seq_rev : 'a Stdlib.Seq.t -> 'a t

of_seq_rev seq builds a list from a given Seq.t, in reverse order. Renamed from to_std_seq_rev since 3.0.

  • since 3.0
val of_seq : 'a Stdlib.Seq.t -> 'a t

of_seq seq builds a list from a given Seq.t. In the result, elements appear in the same order as they did in the source Seq.t. Renamed from of_std_seq since 3.0.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen l returns a gen of the elements of the list l.

val of_gen : 'a gen -> 'a t

of_gen gen builds a list from a given gen. In the result, elements appear in the same order as they did in the source gen.

Infix Operators

It is convenient to open CCList.Infix to access the infix operators without cluttering the scope too much.

  • since 0.16
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a t -> 'a t -> 'a t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> l is like map.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

l >>= f is flat_map f l.

val (--) : int -> int -> int t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a list -> ( 'a -> 'b ) -> 'b list
val and+ : 'a list -> 'b list -> ('a * 'b) list
val let* : 'a list -> ( 'a -> 'b list ) -> 'b list
val and* : 'a list -> 'b list -> ('a * 'b) list
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
+  string

to_string ?start ?stop ?sep item_to_string l prints l to a string using sep as a separator between elements of l.

  • since 2.7
val to_iter : 'a t -> 'a iter

to_iter l returns a iter of the elements of the list l.

  • since 2.8
val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq l returns a Seq.t of the elements of the list l. Renamed from to_std_seq since 3.0.

  • since 3.0
val of_iter : 'a iter -> 'a t

of_iter iter builds a list from a given iter. In the result, elements appear in the same order as they did in the source iter.

  • since 2.8
val of_seq_rev : 'a Stdlib.Seq.t -> 'a t

of_seq_rev seq builds a list from a given Seq.t, in reverse order. Renamed from to_std_seq_rev since 3.0.

  • since 3.0
val of_seq : 'a Stdlib.Seq.t -> 'a t

of_seq seq builds a list from a given Seq.t. In the result, elements appear in the same order as they did in the source Seq.t. Renamed from of_std_seq since 3.0.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen l returns a gen of the elements of the list l.

val of_gen : 'a gen -> 'a t

of_gen gen builds a list from a given gen. In the result, elements appear in the same order as they did in the source gen.

Infix Operators

It is convenient to open CCList.Infix to access the infix operators without cluttering the scope too much.

  • since 0.16
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a t -> 'a t -> 'a t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> l is like map.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

l >>= f is flat_map f l.

val (--) : int -> int -> int t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
     let+ x = xs
     and& y = ys
     and& z = zs in
     x + y + z;;
 val f : int list -> int list -> int list -> int list = <fun>
 # f [1;2] [5;6;7] [10;10];;
-- : int list = [16; 18]
  • since 3.1

IO

val pp : +- : int list = [16; 18]
  • since 3.1

IO

val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> diff --git a/dev/containers/CCListLabels/Infix/index.html b/dev/containers/CCListLabels/Infix/index.html index 3a5b5ff1..db65812e 100644 --- a/dev/containers/CCListLabels/Infix/index.html +++ b/dev/containers/CCListLabels/Infix/index.html @@ -1,9 +1,9 @@ -Infix (containers.CCListLabels.Infix)

Module CCListLabels.Infix

val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a t -> 'a t -> 'a t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> l is like map.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

l >>= f is flat_map f l.

val (--) : int -> int -> int t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a list -> ( 'a -> 'b ) -> 'b list
val and+ : 'a list -> 'b list -> ('a * 'b) list
val let* : 'a list -> ( 'a -> 'b list ) -> 'b list
val and* : 'a list -> 'b list -> ('a * 'b) list
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
+Infix (containers.CCListLabels.Infix)

Module CCListLabels.Infix

val (>|=) : 'a CCList.t -> ( 'a -> 'b ) -> 'b CCList.t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a CCList.t -> 'a CCList.t -> 'a CCList.t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) CCList.t -> 'a CCList.t -> 'b CCList.t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a CCList.t -> 'b CCList.t

f <$> l is like map.

val (>>=) : 'a CCList.t -> ( 'a -> 'b CCList.t ) -> 'b CCList.t

l >>= f is flat_map f l.

val (--) : int -> int -> int CCList.t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int CCList.t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17
val let+ : 'a CCList.t -> ( 'a -> 'b ) -> 'b CCList.t
val and+ : 'a CCList.t -> 'b CCList.t -> ('a * 'b) CCList.t
val let* : 'a CCList.t -> ( 'a -> 'b CCList.t ) -> 'b CCList.t
val and* : 'a CCList.t -> 'b CCList.t -> ('a * 'b) CCList.t
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
     let+ x = xs
     and& y = ys
     and& z = zs in
     x + y + z;;
 val f : int list -> int list -> int list -> int list = <fun>
 # f [1;2] [5;6;7] [10;10];;
-- : int list = [16; 18]
  • since 3.1
\ No newline at end of file +- : int list = [16; 18]
  • since 3.1
\ No newline at end of file diff --git a/dev/containers/CCListLabels/index.html b/dev/containers/CCListLabels/index.html index e9841f28..df933579 100644 --- a/dev/containers/CCListLabels/index.html +++ b/dev/containers/CCListLabels/index.html @@ -121,14 +121,14 @@ val square_even : int list -> int list = <fun> ?sep:string -> ( 'a -> string ) -> 'a t -> - string

to_string ?start ?stop ?sep item_to_string l print l to a string using sep as a separator between elements of l.

  • since 2.7
val to_iter : 'a t -> 'a iter

to_iter l returns a iter of the elements of the list l.

  • since 2.8
val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq l returns a Seq.t of the elements of the list l. Renamed from to_std_seq since 3.0.

  • since 3.0
val of_iter : 'a iter -> 'a t

of_iter iter builds a list from a given iter. In the result, elements appear in the same order as they did in the source iter.

  • since 2.8
val of_seq_rev : 'a Stdlib.Seq.t -> 'a t

of_seq_rev seq builds a list from a given Seq.t, in reverse order. Renamed from of_std_seq_rev since 3.0.

  • since 3.0
val of_seq : 'a Stdlib.Seq.t -> 'a t

of_seq seq builds a list from a given Seq.t. In the result, elements appear in the same order as they did in the source Seq.t. Renamed from of_std_seq since 3.0.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen l returns a gen of the elements of the list l.

val of_gen : 'a gen -> 'a t

of_gen gen builds a list from a given gen. In the result, elements appear in the same order as they did in the source gen.

Infix Operators

It is convenient to openCCList.Infix to access the infix operators without cluttering the scope too much.

  • since 0.16
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a t -> 'a t -> 'a t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> l is like map.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

l >>= f is flat_map f l.

val (--) : int -> int -> int t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a list -> ( 'a -> 'b ) -> 'b list
val and+ : 'a list -> 'b list -> ('a * 'b) list
val let* : 'a list -> ( 'a -> 'b list ) -> 'b list
val and* : 'a list -> 'b list -> ('a * 'b) list
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
+  string

to_string ?start ?stop ?sep item_to_string l print l to a string using sep as a separator between elements of l.

  • since 2.7
val to_iter : 'a t -> 'a iter

to_iter l returns a iter of the elements of the list l.

  • since 2.8
val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq l returns a Seq.t of the elements of the list l. Renamed from to_std_seq since 3.0.

  • since 3.0
val of_iter : 'a iter -> 'a t

of_iter iter builds a list from a given iter. In the result, elements appear in the same order as they did in the source iter.

  • since 2.8
val of_seq_rev : 'a Stdlib.Seq.t -> 'a t

of_seq_rev seq builds a list from a given Seq.t, in reverse order. Renamed from of_std_seq_rev since 3.0.

  • since 3.0
val of_seq : 'a Stdlib.Seq.t -> 'a t

of_seq seq builds a list from a given Seq.t. In the result, elements appear in the same order as they did in the source Seq.t. Renamed from of_std_seq since 3.0.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen l returns a gen of the elements of the list l.

val of_gen : 'a gen -> 'a t

of_gen gen builds a list from a given gen. In the result, elements appear in the same order as they did in the source gen.

Infix Operators

It is convenient to openCCList.Infix to access the infix operators without cluttering the scope too much.

  • since 0.16
module Infix : module type of CCList.Infix
include module type of Infix
val (>|=) : 'a CCList.t -> ( 'a -> 'b ) -> 'b CCList.t

l >|= f is the infix version of map with reversed arguments.

val (@) : 'a CCList.t -> 'a CCList.t -> 'a CCList.t

l1 @ l2 concatenates two lists l1 and l2. As append.

val (<*>) : ( 'a -> 'b ) CCList.t -> 'a CCList.t -> 'b CCList.t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ( 'a -> 'b ) -> 'a CCList.t -> 'b CCList.t

f <$> l is like map.

val (>>=) : 'a CCList.t -> ( 'a -> 'b CCList.t ) -> 'b CCList.t

l >>= f is flat_map f l.

val (--) : int -> int -> int CCList.t

i -- j is the infix alias for range. Bounds included.

val (--^) : int -> int -> int CCList.t

i --^ j is the infix alias for range'. Second bound j excluded.

  • since 0.17
val let+ : 'a CCList.t -> ( 'a -> 'b ) -> 'b CCList.t
val and+ : 'a CCList.t -> 'b CCList.t -> ('a * 'b) CCList.t
val let* : 'a CCList.t -> ( 'a -> 'b CCList.t ) -> 'b CCList.t
val and* : 'a CCList.t -> 'b CCList.t -> ('a * 'b) CCList.t
val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
     let+ x = xs
     and& y = ys
     and& z = zs in
     x + y + z;;
 val f : int list -> int list -> int list -> int list = <fun>
 # f [1;2] [5;6;7] [10;10];;
-- : int list = [16; 18]
  • since 3.1

IO

val pp : +- : int list = [16; 18]
  • since 3.1

IO

val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> diff --git a/dev/containers/CCMonomorphicShims_/index.html b/dev/containers/CCMonomorphicShims_/index.html deleted file mode 100644 index d4f17673..00000000 --- a/dev/containers/CCMonomorphicShims_/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CCMonomorphicShims_ (containers.CCMonomorphicShims_)

Module CCMonomorphicShims_

module Stdlib = Stdlib
\ No newline at end of file diff --git a/dev/containers/CCOpt/Infix/index.html b/dev/containers/CCOpt/Infix/index.html index b922367a..478fd2d3 100644 --- a/dev/containers/CCOpt/Infix/index.html +++ b/dev/containers/CCOpt/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCOpt.Infix)

Module CCOpt.Infix

val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a option -> ( 'a -> 'b ) -> 'b option
val and+ : 'a option -> 'b option -> ('a * 'b) option
val let* : 'a option -> ( 'a -> 'b option ) -> 'b option
val and* : 'a option -> 'b option -> ('a * 'b) option
\ No newline at end of file +Infix (containers.CCOpt.Infix)

Module CCOpt.Infix

val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file diff --git a/dev/containers/CCOpt/index.html b/dev/containers/CCOpt/index.html index 56a77000..43d25931 100644 --- a/dev/containers/CCOpt/index.html +++ b/dev/containers/CCOpt/index.html @@ -4,4 +4,4 @@ ( 'a -> 'b -> 'c ) -> 'a -> 'b -> - 'c option

wrap2 ?handler f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a -> 'a t

pure x is an alias to return.

Alternatives

val or_ : else_:'a t -> 'a t -> 'a t

or_ ~else_ o is o if o is Some _, else_ if o is None.

  • since 1.2
val or_lazy : else_:( unit -> 'a t ) -> 'a t -> 'a t

or_lazy ~else_ o is o if o is Some _, else_ () if o is None.

  • since 1.2
val choice : 'a t list -> 'a t

choice lo returns the first non-None element of the list lo, or None.

val flatten : 'a t t -> 'a t

flatten oo transforms Some x into x.

  • since 2.2
val return_if : bool -> 'a -> 'a t

return_if b x applies Some or None depending on the boolean b. More precisely, return_if false x is None, and return_if true x is Some x.

  • since 2.2

Infix Operators

  • since 0.16
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a option -> ( 'a -> 'b ) -> 'b option
val and+ : 'a option -> 'b option -> ('a * 'b) option
val let* : 'a option -> ( 'a -> 'b option ) -> 'b option
val and* : 'a option -> 'b option -> ('a * 'b) option

Conversion and IO

val to_list : 'a t -> 'a list

to_list o returns [x] if o is Some x or the empty list [] if o is None.

val of_list : 'a list -> 'a t

of_list l returns Some x (x being the head of the list l), or None if l is the empty list.

val to_result : 'e -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result e o returns Ok x if o is Some x, or Error e if o is None.

  • since 1.2
val to_result_lazy : ( unit -> 'e ) -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result_lazy f o returns Ok x if o is Some x or Error f if o is None.

  • since 1.2
val of_result : ( 'a, _ ) Stdlib.result -> 'a t

of_result result returns an option from a result.

  • since 1.2
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val random : 'a random_gen -> 'a t random_gen
val choice_iter : 'a t iter -> 'a t

choice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.

  • since 3.0
val choice_seq : 'a t Stdlib.Seq.t -> 'a t

choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen o is o as a gen. Some x is the singleton gen containing x and None is the empty gen.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq o is o as a sequence Seq.t. Some x is the singleton sequence containing x and None is the empty sequence. Same as Stdlib.Option.to_seq Renamed from to_std_seq since 3.0.

  • since 3.0
val to_iter : 'a t -> 'a iter

to_iter o returns an internal iterator, like in the library Iter.

  • since 2.8
val pp : 'a printer -> 'a t printer

pp ppf o pretty-prints option o using ppf.

\ No newline at end of file + 'c option

wrap2 ?handler f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a -> 'a t

pure x is an alias to return.

Alternatives

val or_ : else_:'a t -> 'a t -> 'a t

or_ ~else_ o is o if o is Some _, else_ if o is None.

  • since 1.2
val or_lazy : else_:( unit -> 'a t ) -> 'a t -> 'a t

or_lazy ~else_ o is o if o is Some _, else_ () if o is None.

  • since 1.2
val choice : 'a t list -> 'a t

choice lo returns the first non-None element of the list lo, or None.

val flatten : 'a t t -> 'a t

flatten oo transforms Some x into x.

  • since 2.2
val return_if : bool -> 'a -> 'a t

return_if b x applies Some or None depending on the boolean b. More precisely, return_if false x is None, and return_if true x is Some x.

  • since 2.2

Infix Operators

  • since 0.16
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t

Conversion and IO

val to_list : 'a t -> 'a list

to_list o returns [x] if o is Some x or the empty list [] if o is None.

val of_list : 'a list -> 'a t

of_list l returns Some x (x being the head of the list l), or None if l is the empty list.

val to_result : 'e -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result e o returns Ok x if o is Some x, or Error e if o is None.

  • since 1.2
val to_result_lazy : ( unit -> 'e ) -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result_lazy f o returns Ok x if o is Some x or Error f if o is None.

  • since 1.2
val of_result : ( 'a, _ ) Stdlib.result -> 'a t

of_result result returns an option from a result.

  • since 1.2
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val random : 'a random_gen -> 'a t random_gen
val choice_iter : 'a t iter -> 'a t

choice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.

  • since 3.0
val choice_seq : 'a t Stdlib.Seq.t -> 'a t

choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen o is o as a gen. Some x is the singleton gen containing x and None is the empty gen.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq o is o as a sequence Seq.t. Some x is the singleton sequence containing x and None is the empty sequence. Same as Stdlib.Option.to_seq Renamed from to_std_seq since 3.0.

  • since 3.0
val to_iter : 'a t -> 'a iter

to_iter o returns an internal iterator, like in the library Iter.

  • since 2.8
val pp : 'a printer -> 'a t printer

pp ppf o pretty-prints option o using ppf.

\ No newline at end of file diff --git a/dev/containers/CCOption/Infix/index.html b/dev/containers/CCOption/Infix/index.html index 56462c48..a41aee2b 100644 --- a/dev/containers/CCOption/Infix/index.html +++ b/dev/containers/CCOption/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCOption.Infix)

Module CCOption.Infix

val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a option -> ( 'a -> 'b ) -> 'b option
val and+ : 'a option -> 'b option -> ('a * 'b) option
val let* : 'a option -> ( 'a -> 'b option ) -> 'b option
val and* : 'a option -> 'b option -> ('a * 'b) option
\ No newline at end of file +Infix (containers.CCOption.Infix)

Module CCOption.Infix

val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file diff --git a/dev/containers/CCOption/index.html b/dev/containers/CCOption/index.html index eae609b2..4bd88c33 100644 --- a/dev/containers/CCOption/index.html +++ b/dev/containers/CCOption/index.html @@ -4,4 +4,4 @@ ( 'a -> 'b -> 'c ) -> 'a -> 'b -> - 'c option

wrap2 ?handler f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a -> 'a t

pure x is an alias to return.

Alternatives

val or_ : else_:'a t -> 'a t -> 'a t

or_ ~else_ o is o if o is Some _, else_ if o is None.

  • since 1.2
val or_lazy : else_:( unit -> 'a t ) -> 'a t -> 'a t

or_lazy ~else_ o is o if o is Some _, else_ () if o is None.

  • since 1.2
val choice : 'a t list -> 'a t

choice lo returns the first non-None element of the list lo, or None.

val flatten : 'a t t -> 'a t

flatten oo transforms Some x into x.

  • since 2.2
val return_if : bool -> 'a -> 'a t

return_if b x applies Some or None depending on the boolean b. More precisely, return_if false x is None, and return_if true x is Some x.

  • since 2.2

Infix Operators

  • since 0.16
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a option -> ( 'a -> 'b ) -> 'b option
val and+ : 'a option -> 'b option -> ('a * 'b) option
val let* : 'a option -> ( 'a -> 'b option ) -> 'b option
val and* : 'a option -> 'b option -> ('a * 'b) option

Conversion and IO

val to_list : 'a t -> 'a list

to_list o returns [x] if o is Some x or the empty list [] if o is None.

val of_list : 'a list -> 'a t

of_list l returns Some x (x being the head of the list l), or None if l is the empty list.

val to_result : 'e -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result e o returns Ok x if o is Some x, or Error e if o is None.

  • since 1.2
val to_result_lazy : ( unit -> 'e ) -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result_lazy f o returns Ok x if o is Some x or Error f if o is None.

  • since 1.2
val of_result : ( 'a, _ ) Stdlib.result -> 'a t

of_result result returns an option from a result.

  • since 1.2
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val random : 'a random_gen -> 'a t random_gen
val choice_iter : 'a t iter -> 'a t

choice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.

  • since 3.0
val choice_seq : 'a t Stdlib.Seq.t -> 'a t

choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen o is o as a gen. Some x is the singleton gen containing x and None is the empty gen.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq o is o as a sequence Seq.t. Some x is the singleton sequence containing x and None is the empty sequence. Same as Stdlib.Option.to_seq Renamed from to_std_seq since 3.0.

  • since 3.0
val to_iter : 'a t -> 'a iter

to_iter o returns an internal iterator, like in the library Iter.

  • since 2.8
val pp : 'a printer -> 'a t printer

pp ppf o pretty-prints option o using ppf.

\ No newline at end of file + 'c option

wrap2 ?handler f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a -> 'a t

pure x is an alias to return.

Alternatives

val or_ : else_:'a t -> 'a t -> 'a t

or_ ~else_ o is o if o is Some _, else_ if o is None.

  • since 1.2
val or_lazy : else_:( unit -> 'a t ) -> 'a t -> 'a t

or_lazy ~else_ o is o if o is Some _, else_ () if o is None.

  • since 1.2
val choice : 'a t list -> 'a t

choice lo returns the first non-None element of the list lo, or None.

val flatten : 'a t t -> 'a t

flatten oo transforms Some x into x.

  • since 2.2
val return_if : bool -> 'a -> 'a t

return_if b x applies Some or None depending on the boolean b. More precisely, return_if false x is None, and return_if true x is Some x.

  • since 2.2

Infix Operators

module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t

o >|= f is map f o.

val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t

o >>= f is the monadic bind.

val (<*>) : ( 'a -> 'b ) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ( 'a -> 'b ) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t

Conversion and IO

val to_list : 'a t -> 'a list

to_list o returns [x] if o is Some x or the empty list [] if o is None.

val of_list : 'a list -> 'a t

of_list l returns Some x (x being the head of the list l), or None if l is the empty list.

val to_result : 'e -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result e o returns Ok x if o is Some x, or Error e if o is None.

  • since 1.2
val to_result_lazy : ( unit -> 'e ) -> 'a t -> ( 'a, 'e ) Stdlib.result

to_result_lazy f o returns Ok x if o is Some x or Error f if o is None.

  • since 1.2
val of_result : ( 'a, _ ) Stdlib.result -> 'a t

of_result result returns an option from a result.

  • since 1.2
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val random : 'a random_gen -> 'a t random_gen
val choice_iter : 'a t iter -> 'a t

choice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.

  • since 3.0
val choice_seq : 'a t Stdlib.Seq.t -> 'a t

choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.

  • since 3.0
val to_gen : 'a t -> 'a gen

to_gen o is o as a gen. Some x is the singleton gen containing x and None is the empty gen.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq o is o as a sequence Seq.t. Some x is the singleton sequence containing x and None is the empty sequence. Same as Stdlib.Option.to_seq Renamed from to_std_seq since 3.0.

  • since 3.0
val to_iter : 'a t -> 'a iter

to_iter o returns an internal iterator, like in the library Iter.

  • since 2.8
val pp : 'a printer -> 'a t printer

pp ppf o pretty-prints option o using ppf.

\ No newline at end of file diff --git a/dev/containers/CCResult/Infix/index.html b/dev/containers/CCResult/Infix/index.html index e261b42d..997b9fe4 100644 --- a/dev/containers/CCResult/Infix/index.html +++ b/dev/containers/CCResult/Infix/index.html @@ -1,5 +1,2 @@ -Infix (containers.CCResult.Infix)

Module CCResult.Infix

val (<$>) : ( 'a -> 'b ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t

Infix version of map.

  • since 3.0
val (>|=) : ( 'a, 'err ) t -> ( 'a -> 'b ) -> ( 'b, 'err ) t

Infix version of map with reversed arguments.

val (>>=) : ( 'a, 'err ) t -> ( 'a -> ( 'b, 'err ) t ) -> ( 'b, 'err ) t

Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.

val (<*>) : ( 'a -> 'b, 'err ) t -> ( 'a, 'err ) t -> ( 'b, 'err ) t

a <*> b evaluates a and b, and, in case of success, returns Ok (a b). Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : ( 'a, 'e ) result -> ( 'a -> 'b ) -> ( 'b, 'e ) result
val and+ : ( 'a, 'e ) result -> ( 'b, 'e ) result -> ( 'a * 'b, 'e ) result
val let* : - ( 'a, 'e ) result -> - ( 'a -> ( 'b, 'e ) result ) -> - ( 'b, 'e ) result
val and* : ( 'a, 'e ) result -> ( 'b, 'e ) result -> ( 'a * 'b, 'e ) result
\ No newline at end of file +Infix (containers.CCResult.Infix)

Module CCResult.Infix

val (<$>) : ( 'a -> 'b ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t

Infix version of map.

  • since 3.0
val (>|=) : ( 'a, 'err ) t -> ( 'a -> 'b ) -> ( 'b, 'err ) t

Infix version of map with reversed arguments.

val (>>=) : ( 'a, 'err ) t -> ( 'a -> ( 'b, 'err ) t ) -> ( 'b, 'err ) t

Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.

val (<*>) : ( 'a -> 'b, 'err ) t -> ( 'a, 'err ) t -> ( 'b, 'err ) t

a <*> b evaluates a and b, and, in case of success, returns Ok (a b). Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

val let+ : ( 'a, 'e ) t -> ( 'a -> 'b ) -> ( 'b, 'e ) t
  • since 2.8
val and+ : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8
val let* : ( 'a, 'e ) t -> ( 'a -> ( 'b, 'e ) t ) -> ( 'b, 'e ) t
  • since 2.8
val and* : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8
\ No newline at end of file diff --git a/dev/containers/CCResult/index.html b/dev/containers/CCResult/index.html index 6d782a02..39291d81 100644 --- a/dev/containers/CCResult/index.html +++ b/dev/containers/CCResult/index.html @@ -10,10 +10,7 @@ ( 'a -> 'b ) -> ( 'err1 -> 'err2 ) -> ( 'a, 'err1 ) t -> - ( 'b, 'err2 ) t

Like map, but also with a function that can transform the error message in case of failure.

val iter : ( 'a -> unit ) -> ( 'a, _ ) t -> unit

Apply the function only in case of Ok.

val iter_err : ( 'err -> unit ) -> ( _, 'err ) t -> unit

Apply the function in case of Error.

  • since 2.4
exception Get_error
val get_exn : ( 'a, _ ) t -> 'a

Extract the value x from Ok x, fails otherwise. You should be careful with this function, and favor other combinators whenever possible.

  • raises Get_error

    if the value is an error.

val get_or : ( 'a, _ ) t -> default:'a -> 'a

get_or e ~default returns x if e = Ok x, default otherwise.

val get_or_failwith : ( 'a, string ) t -> 'a

get_or_failwith e returns x if e = Ok x, fails otherwise.

  • raises Failure

    with msg if e = Error msg.

  • since 2.4
val get_lazy : ( 'b -> 'a ) -> ( 'a, 'b ) t -> 'a

get_lazy default_fn x unwraps x, but if x = Error e it returns default_fr e instead.

  • since 3.0
val map_or : ( 'a -> 'b ) -> ( 'a, 'c ) t -> default:'b -> 'b

map_or f e ~default returns f x if e = Ok x, default otherwise.

val catch : ( 'a, 'err ) t -> ok:( 'a -> 'b ) -> err:( 'err -> 'b ) -> 'b

catch e ~ok ~err calls either ok or err depending on the value of e.

val flat_map : ( 'a -> ( 'b, 'err ) t ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t
val equal : err:'err equal -> 'a equal -> ( 'a, 'err ) t equal
val compare : err:'err ord -> 'a ord -> ( 'a, 'err ) t ord
val fold : ok:( 'a -> 'b ) -> error:( 'err -> 'b ) -> ( 'a, 'err ) t -> 'b

fold ~ok ~error e opens e and, if e = Ok x, returns ok x, otherwise e = Error s and it returns error s.

val fold_ok : ( 'a -> 'b -> 'a ) -> 'a -> ( 'b, _ ) t -> 'a

fold_ok f acc r will compute f acc x if r=Ok x, and return acc otherwise, as if the result were a mere option.

  • since 1.2
val is_ok : ( 'a, 'err ) t -> bool

Return true if Ok.

  • since 1.0
val is_error : ( 'a, 'err ) t -> bool

Return true if Error.

  • since 1.0

Wrappers

val guard : ( unit -> 'a ) -> ( 'a, exn ) t

guard f runs f () and returns its result wrapped in Ok. If f () raises some exception e, then it fails with Error e.

val guard_str : ( unit -> 'a ) -> ( 'a, string ) t

Like guard but uses of_exn to print the exception.

val guard_str_trace : ( unit -> 'a ) -> ( 'a, string ) t

Like guard_str but uses of_exn_trace instead of of_exn so that the stack trace is printed.

val wrap1 : ( 'a -> 'b ) -> 'a -> ( 'b, exn ) t

Like guard but gives the function one argument.

val wrap2 : ( 'a -> 'b -> 'c ) -> 'a -> 'b -> ( 'c, exn ) t

Like guard but gives the function two arguments.

val wrap3 : ( 'a -> 'b -> 'c -> 'd ) -> 'a -> 'b -> 'c -> ( 'd, exn ) t

Like guard but gives the function three arguments.

Applicative

val pure : 'a -> ( 'a, 'err ) t

Synonym of return.

val join : ( ( 'a, 'err ) t, 'err ) t -> ( 'a, 'err ) t

join t, in case of success, returns Ok o from Ok (Ok o). Otherwise, it fails with Error e where e is the unwrapped error of t.

val both : ( 'a, 'err ) t -> ( 'b, 'err ) t -> ( 'a * 'b, 'err ) t

both a b, in case of success, returns Ok (o, o') with the ok values of a and b. Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

Infix

module Infix : sig ... end
include module type of Infix
val (<$>) : ( 'a -> 'b ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t

Infix version of map.

  • since 3.0
val (>|=) : ( 'a, 'err ) t -> ( 'a -> 'b ) -> ( 'b, 'err ) t

Infix version of map with reversed arguments.

val (>>=) : ( 'a, 'err ) t -> ( 'a -> ( 'b, 'err ) t ) -> ( 'b, 'err ) t

Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.

val (<*>) : ( 'a -> 'b, 'err ) t -> ( 'a, 'err ) t -> ( 'b, 'err ) t

a <*> b evaluates a and b, and, in case of success, returns Ok (a b). Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : ( 'a, 'e ) result -> ( 'a -> 'b ) -> ( 'b, 'e ) result
val and+ : ( 'a, 'e ) result -> ( 'b, 'e ) result -> ( 'a * 'b, 'e ) result
val let* : - ( 'a, 'e ) result -> - ( 'a -> ( 'b, 'e ) result ) -> - ( 'b, 'e ) result
val and* : ( 'a, 'e ) result -> ( 'b, 'e ) result -> ( 'a * 'b, 'e ) result

Collections

val flatten_l : ( 'a, 'err ) t list -> ( 'a list, 'err ) t

Same as map_l id: returns Ok [x1;…;xn] if l=[Ok x1; …; Ok xn], or the first error otherwise.

  • since 2.7
val map_l : ( 'a -> ( 'b, 'err ) t ) -> 'a list -> ( 'b list, 'err ) t

map_l f [a1; …; an] applies the function f to a1, …, an ,and, in case of success for every element, returns the list of Ok-value. Otherwise, it fails and returns the first error encountered. Tail-recursive.

val fold_l : ( 'b -> 'a -> ( 'b, 'err ) t ) -> 'b -> 'a list -> ( 'b, 'err ) t
val fold_iter : + ( 'b, 'err2 ) t

Like map, but also with a function that can transform the error message in case of failure.

val iter : ( 'a -> unit ) -> ( 'a, _ ) t -> unit

Apply the function only in case of Ok.

val iter_err : ( 'err -> unit ) -> ( _, 'err ) t -> unit

Apply the function in case of Error.

  • since 2.4
exception Get_error
val get_exn : ( 'a, _ ) t -> 'a

Extract the value x from Ok x, fails otherwise. You should be careful with this function, and favor other combinators whenever possible.

  • raises Get_error

    if the value is an error.

val get_or : ( 'a, _ ) t -> default:'a -> 'a

get_or e ~default returns x if e = Ok x, default otherwise.

val get_or_failwith : ( 'a, string ) t -> 'a

get_or_failwith e returns x if e = Ok x, fails otherwise.

  • raises Failure

    with msg if e = Error msg.

  • since 2.4
val get_lazy : ( 'b -> 'a ) -> ( 'a, 'b ) t -> 'a

get_lazy default_fn x unwraps x, but if x = Error e it returns default_fr e instead.

  • since 3.0
val map_or : ( 'a -> 'b ) -> ( 'a, 'c ) t -> default:'b -> 'b

map_or f e ~default returns f x if e = Ok x, default otherwise.

val catch : ( 'a, 'err ) t -> ok:( 'a -> 'b ) -> err:( 'err -> 'b ) -> 'b

catch e ~ok ~err calls either ok or err depending on the value of e.

val flat_map : ( 'a -> ( 'b, 'err ) t ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t
val equal : err:'err equal -> 'a equal -> ( 'a, 'err ) t equal
val compare : err:'err ord -> 'a ord -> ( 'a, 'err ) t ord
val fold : ok:( 'a -> 'b ) -> error:( 'err -> 'b ) -> ( 'a, 'err ) t -> 'b

fold ~ok ~error e opens e and, if e = Ok x, returns ok x, otherwise e = Error s and it returns error s.

val fold_ok : ( 'a -> 'b -> 'a ) -> 'a -> ( 'b, _ ) t -> 'a

fold_ok f acc r will compute f acc x if r=Ok x, and return acc otherwise, as if the result were a mere option.

  • since 1.2
val is_ok : ( 'a, 'err ) t -> bool

Return true if Ok.

  • since 1.0
val is_error : ( 'a, 'err ) t -> bool

Return true if Error.

  • since 1.0

Wrappers

val guard : ( unit -> 'a ) -> ( 'a, exn ) t

guard f runs f () and returns its result wrapped in Ok. If f () raises some exception e, then it fails with Error e.

val guard_str : ( unit -> 'a ) -> ( 'a, string ) t

Like guard but uses of_exn to print the exception.

val guard_str_trace : ( unit -> 'a ) -> ( 'a, string ) t

Like guard_str but uses of_exn_trace instead of of_exn so that the stack trace is printed.

val wrap1 : ( 'a -> 'b ) -> 'a -> ( 'b, exn ) t

Like guard but gives the function one argument.

val wrap2 : ( 'a -> 'b -> 'c ) -> 'a -> 'b -> ( 'c, exn ) t

Like guard but gives the function two arguments.

val wrap3 : ( 'a -> 'b -> 'c -> 'd ) -> 'a -> 'b -> 'c -> ( 'd, exn ) t

Like guard but gives the function three arguments.

Applicative

val pure : 'a -> ( 'a, 'err ) t

Synonym of return.

val join : ( ( 'a, 'err ) t, 'err ) t -> ( 'a, 'err ) t

join t, in case of success, returns Ok o from Ok (Ok o). Otherwise, it fails with Error e where e is the unwrapped error of t.

val both : ( 'a, 'err ) t -> ( 'b, 'err ) t -> ( 'a * 'b, 'err ) t

both a b, in case of success, returns Ok (o, o') with the ok values of a and b. Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

Infix

module Infix : sig ... end
include module type of Infix
val (<$>) : ( 'a -> 'b ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t

Infix version of map.

  • since 3.0
val (>|=) : ( 'a, 'err ) t -> ( 'a -> 'b ) -> ( 'b, 'err ) t

Infix version of map with reversed arguments.

val (>>=) : ( 'a, 'err ) t -> ( 'a -> ( 'b, 'err ) t ) -> ( 'b, 'err ) t

Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.

val (<*>) : ( 'a -> 'b, 'err ) t -> ( 'a, 'err ) t -> ( 'b, 'err ) t

a <*> b evaluates a and b, and, in case of success, returns Ok (a b). Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

val let+ : ( 'a, 'e ) t -> ( 'a -> 'b ) -> ( 'b, 'e ) t
  • since 2.8
val and+ : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8
val let* : ( 'a, 'e ) t -> ( 'a -> ( 'b, 'e ) t ) -> ( 'b, 'e ) t
  • since 2.8
val and* : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8

Collections

val flatten_l : ( 'a, 'err ) t list -> ( 'a list, 'err ) t

Same as map_l id: returns Ok [x1;…;xn] if l=[Ok x1; …; Ok xn], or the first error otherwise.

  • since 2.7
val map_l : ( 'a -> ( 'b, 'err ) t ) -> 'a list -> ( 'b list, 'err ) t

map_l f [a1; …; an] applies the function f to a1, …, an ,and, in case of success for every element, returns the list of Ok-value. Otherwise, it fails and returns the first error encountered. Tail-recursive.

val fold_l : ( 'b -> 'a -> ( 'b, 'err ) t ) -> 'b -> 'a list -> ( 'b, 'err ) t
val fold_iter : ( 'b -> 'a -> ( 'b, 'err ) t ) -> 'b -> 'a iter -> diff --git a/dev/containers/CCShimsArrayLabels_/.dummy b/dev/containers/CCShimsArrayLabels_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsArrayLabels_/Floatarray/index.html b/dev/containers/CCShimsArrayLabels_/Floatarray/index.html deleted file mode 100644 index 863c6e50..00000000 --- a/dev/containers/CCShimsArrayLabels_/Floatarray/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Floatarray (containers.CCShimsArrayLabels_.Floatarray)

Module CCShimsArrayLabels_.Floatarray

val create : int -> floatarray
val length : floatarray -> int
val get : floatarray -> int -> float
val set : floatarray -> int -> float -> unit
val unsafe_get : floatarray -> int -> float
val unsafe_set : floatarray -> int -> float -> unit
\ No newline at end of file diff --git a/dev/containers/CCShimsArrayLabels_/index.html b/dev/containers/CCShimsArrayLabels_/index.html deleted file mode 100644 index 83203da8..00000000 --- a/dev/containers/CCShimsArrayLabels_/index.html +++ /dev/null @@ -1,13 +0,0 @@ - -CCShimsArrayLabels_ (containers.CCShimsArrayLabels_)

Module CCShimsArrayLabels_

include module type of Stdlib.ArrayLabels - with module Floatarray = Stdlib.Array.Floatarray
type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> f:( int -> 'a ) -> 'a array
val make_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val create_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> pos:int -> len:int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> pos:int -> len:int -> 'a -> unit
val blit : - src:'a array -> - src_pos:int -> - dst:'a array -> - dst_pos:int -> - len:int -> - unit
val to_list : 'a array -> 'a list
val of_list : 'a list -> 'a array
val iter : f:( 'a -> unit ) -> 'a array -> unit
val iteri : f:( int -> 'a -> unit ) -> 'a array -> unit
val map : f:( 'a -> 'b ) -> 'a array -> 'b array
val mapi : f:( int -> 'a -> 'b ) -> 'a array -> 'b array
val fold_left : f:( 'a -> 'b -> 'a ) -> init:'a -> 'b array -> 'a
val fold_left_map : - f:( 'a -> 'b -> 'a * 'c ) -> - init:'a -> - 'b array -> - 'a * 'c array
val fold_right : f:( 'b -> 'a -> 'a ) -> 'b array -> init:'a -> 'a
val iter2 : f:( 'a -> 'b -> unit ) -> 'a array -> 'b array -> unit
val map2 : f:( 'a -> 'b -> 'c ) -> 'a array -> 'b array -> 'c array
val for_all : f:( 'a -> bool ) -> 'a array -> bool
val exists : f:( 'a -> bool ) -> 'a array -> bool
val for_all2 : f:( 'a -> 'b -> bool ) -> 'a array -> 'b array -> bool
val exists2 : f:( 'a -> 'b -> bool ) -> 'a array -> 'b array -> bool
val mem : 'a -> set:'a array -> bool
val memq : 'a -> set:'a array -> bool
val find_opt : f:( 'a -> bool ) -> 'a array -> 'a option
val find_map : f:( 'a -> 'b option ) -> 'a array -> 'b option
val split : ('a * 'b) array -> 'a array * 'b array
val combine : 'a array -> 'b array -> ('a * 'b) array
val sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val stable_sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val fast_sort : cmp:( 'a -> 'a -> int ) -> 'a array -> unit
val to_seq : 'a array -> 'a Stdlib.Seq.t
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray : sig ... end
\ No newline at end of file diff --git a/dev/containers/CCShimsArray_/.dummy b/dev/containers/CCShimsArray_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsArray_/index.html b/dev/containers/CCShimsArray_/index.html deleted file mode 100644 index 4ca745fd..00000000 --- a/dev/containers/CCShimsArray_/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CCShimsArray_ (containers.CCShimsArray_)

Module CCShimsArray_

include module type of struct include Stdlib.Array end
type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> ( int -> 'a ) -> 'a array
val make_matrix : int -> int -> 'a -> 'a array array
val create_matrix : int -> int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> int -> int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> int -> int -> 'a -> unit
val blit : 'a array -> int -> 'a array -> int -> int -> unit
val to_list : 'a array -> 'a list
val of_list : 'a list -> 'a array
val iter : ( 'a -> unit ) -> 'a array -> unit
val iteri : ( int -> 'a -> unit ) -> 'a array -> unit
val map : ( 'a -> 'b ) -> 'a array -> 'b array
val mapi : ( int -> 'a -> 'b ) -> 'a array -> 'b array
val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b array -> 'a
val fold_left_map : ( 'a -> 'b -> 'a * 'c ) -> 'a -> 'b array -> 'a * 'c array
val fold_right : ( 'b -> 'a -> 'a ) -> 'b array -> 'a -> 'a
val iter2 : ( 'a -> 'b -> unit ) -> 'a array -> 'b array -> unit
val map2 : ( 'a -> 'b -> 'c ) -> 'a array -> 'b array -> 'c array
val for_all : ( 'a -> bool ) -> 'a array -> bool
val exists : ( 'a -> bool ) -> 'a array -> bool
val for_all2 : ( 'a -> 'b -> bool ) -> 'a array -> 'b array -> bool
val exists2 : ( 'a -> 'b -> bool ) -> 'a array -> 'b array -> bool
val mem : 'a -> 'a array -> bool
val memq : 'a -> 'a array -> bool
val find_opt : ( 'a -> bool ) -> 'a array -> 'a option
val find_map : ( 'a -> 'b option ) -> 'a array -> 'b option
val split : ('a * 'b) array -> 'a array * 'b array
val combine : 'a array -> 'b array -> ('a * 'b) array
val sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val stable_sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val fast_sort : ( 'a -> 'a -> int ) -> 'a array -> unit
val to_seq : 'a array -> 'a Stdlib.Seq.t
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray = Stdlib__Array.Floatarray
\ No newline at end of file diff --git a/dev/containers/CCShimsFormat_/.dummy b/dev/containers/CCShimsFormat_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsFormat_/index.html b/dev/containers/CCShimsFormat_/index.html deleted file mode 100644 index 60f8ad40..00000000 --- a/dev/containers/CCShimsFormat_/index.html +++ /dev/null @@ -1,12 +0,0 @@ - -CCShimsFormat_ (containers.CCShimsFormat_)

Module CCShimsFormat_

val pp_open_tag : Stdlib.Format.formatter -> Stdlib.Format.tag -> unit
val pp_close_tag : Stdlib.Format.formatter -> unit -> unit
val pp_get_formatter_tag_functions : - Stdlib.Format.formatter -> - unit -> - Stdlib.Format.formatter_tag_functions
val pp_set_formatter_tag_functions : - Stdlib.Format.formatter -> - Stdlib.Format.formatter_tag_functions -> - unit
val cc_update_funs : - Stdlib.Format.formatter_tag_functions -> - ( or_else:( Stdlib.Format.tag -> string ) -> Stdlib.Format.tag -> string ) -> - ( or_else:( Stdlib.Format.tag -> string ) -> Stdlib.Format.tag -> string ) -> - Stdlib.Format.formatter_tag_functions
\ No newline at end of file diff --git a/dev/containers/CCShimsFun_/.dummy b/dev/containers/CCShimsFun_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsFun_/index.html b/dev/containers/CCShimsFun_/index.html deleted file mode 100644 index 559a48fb..00000000 --- a/dev/containers/CCShimsFun_/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CCShimsFun_ (containers.CCShimsFun_)

Module CCShimsFun_

include module type of Stdlib.Fun
val id : 'a -> 'a
val const : 'a -> 'b -> 'a
val flip : ( 'a -> 'b -> 'c ) -> 'b -> 'a -> 'c
val negate : ( 'a -> bool ) -> 'a -> bool
val protect : finally:( unit -> unit ) -> ( unit -> 'a ) -> 'a
exception Finally_raised of exn
\ No newline at end of file diff --git a/dev/containers/CCShimsInt_/.dummy b/dev/containers/CCShimsInt_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsInt_/index.html b/dev/containers/CCShimsInt_/index.html deleted file mode 100644 index 71cf86c2..00000000 --- a/dev/containers/CCShimsInt_/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CCShimsInt_ (containers.CCShimsInt_)

Module CCShimsInt_

include module type of struct include Stdlib.Int end
type t = int
val zero : int
val one : int
val minus_one : int
val neg : int -> int
val add : int -> int -> int
val sub : int -> int -> int
val mul : int -> int -> int
val div : int -> int -> int
val rem : int -> int -> int
val succ : int -> int
val pred : int -> int
val abs : int -> int
val max_int : int
val min_int : int
val logand : int -> int -> int
val logor : int -> int -> int
val logxor : int -> int -> int
val lognot : int -> int
val shift_left : int -> int -> int
val shift_right : int -> int -> int
val shift_right_logical : int -> int -> int
val equal : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int
val to_float : int -> float
val of_float : float -> int
val to_string : int -> string
\ No newline at end of file diff --git a/dev/containers/CCShimsList_/.dummy b/dev/containers/CCShimsList_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsList_/index.html b/dev/containers/CCShimsList_/index.html deleted file mode 100644 index ba57d7e7..00000000 --- a/dev/containers/CCShimsList_/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -CCShimsList_ (containers.CCShimsList_)

Module CCShimsList_

include module type of struct include Stdlib.List end
type !'a t = 'a list =
| []
| :: of 'a * 'a list
val length : 'a list -> int
val compare_lengths : 'a list -> 'b list -> int
val compare_length_with : 'a list -> int -> int
val cons : 'a -> 'a list -> 'a list
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val nth_opt : 'a list -> int -> 'a option
val rev : 'a list -> 'a list
val init : int -> ( int -> 'a ) -> 'a list
val append : 'a list -> 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val flatten : 'a list list -> 'a list
val equal : ( 'a -> 'a -> bool ) -> 'a list -> 'a list -> bool
val compare : ( 'a -> 'a -> int ) -> 'a list -> 'a list -> int
val iter : ( 'a -> unit ) -> 'a list -> unit
val iteri : ( int -> 'a -> unit ) -> 'a list -> unit
val map : ( 'a -> 'b ) -> 'a list -> 'b list
val mapi : ( int -> 'a -> 'b ) -> 'a list -> 'b list
val rev_map : ( 'a -> 'b ) -> 'a list -> 'b list
val filter_map : ( 'a -> 'b option ) -> 'a list -> 'b list
val concat_map : ( 'a -> 'b list ) -> 'a list -> 'b list
val fold_left_map : ( 'a -> 'b -> 'a * 'c ) -> 'a -> 'b list -> 'a * 'c list
val fold_left : ( 'a -> 'b -> 'a ) -> 'a -> 'b list -> 'a
val fold_right : ( 'a -> 'b -> 'b ) -> 'a list -> 'b -> 'b
val iter2 : ( 'a -> 'b -> unit ) -> 'a list -> 'b list -> unit
val map2 : ( 'a -> 'b -> 'c ) -> 'a list -> 'b list -> 'c list
val rev_map2 : ( 'a -> 'b -> 'c ) -> 'a list -> 'b list -> 'c list
val fold_left2 : ( 'a -> 'b -> 'c -> 'a ) -> 'a -> 'b list -> 'c list -> 'a
val fold_right2 : ( 'a -> 'b -> 'c -> 'c ) -> 'a list -> 'b list -> 'c -> 'c
val for_all : ( 'a -> bool ) -> 'a list -> bool
val exists : ( 'a -> bool ) -> 'a list -> bool
val for_all2 : ( 'a -> 'b -> bool ) -> 'a list -> 'b list -> bool
val exists2 : ( 'a -> 'b -> bool ) -> 'a list -> 'b list -> bool
val mem : 'a -> 'a list -> bool
val memq : 'a -> 'a list -> bool
val find : ( 'a -> bool ) -> 'a list -> 'a
val find_opt : ( 'a -> bool ) -> 'a list -> 'a option
val find_map : ( 'a -> 'b option ) -> 'a list -> 'b option
val filter : ( 'a -> bool ) -> 'a list -> 'a list
val find_all : ( 'a -> bool ) -> 'a list -> 'a list
val filteri : ( int -> 'a -> bool ) -> 'a list -> 'a list
val partition : ( 'a -> bool ) -> 'a list -> 'a list * 'a list
val partition_map : - ( 'a -> ( 'b, 'c ) Stdlib.Either.t ) -> - 'a list -> - 'b list * 'c list
val assoc : 'a -> ('a * 'b) list -> 'b
val assoc_opt : 'a -> ('a * 'b) list -> 'b option
val assq : 'a -> ('a * 'b) list -> 'b
val assq_opt : 'a -> ('a * 'b) list -> 'b option
val mem_assoc : 'a -> ('a * 'b) list -> bool
val mem_assq : 'a -> ('a * 'b) list -> bool
val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list
val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
val split : ('a * 'b) list -> 'a list * 'b list
val combine : 'a list -> 'b list -> ('a * 'b) list
val sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val stable_sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val fast_sort : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val sort_uniq : ( 'a -> 'a -> int ) -> 'a list -> 'a list
val merge : ( 'a -> 'a -> int ) -> 'a list -> 'a list -> 'a list
val to_seq : 'a list -> 'a Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a list
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLetList_/.dummy b/dev/containers/CCShimsMkLetList_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsMkLetList_/Make/argument-1-X/index.html b/dev/containers/CCShimsMkLetList_/Make/argument-1-X/index.html deleted file mode 100644 index c07c7c4f..00000000 --- a/dev/containers/CCShimsMkLetList_/Make/argument-1-X/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -X (containers.CCShimsMkLetList_.Make.1-X)

Parameter Make.1-X

val combine_shortest : 'a list -> 'b list -> ('a * 'b) list
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLetList_/Make/index.html b/dev/containers/CCShimsMkLetList_/Make/index.html deleted file mode 100644 index a46f4055..00000000 --- a/dev/containers/CCShimsMkLetList_/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (containers.CCShimsMkLetList_.Make)

Module CCShimsMkLetList_.Make

Parameters

module X : sig ... end

Signature

val and& : 'a list -> 'b list -> ('a * 'b) list
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLetList_/index.html b/dev/containers/CCShimsMkLetList_/index.html deleted file mode 100644 index 13b9f9bb..00000000 --- a/dev/containers/CCShimsMkLetList_/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CCShimsMkLetList_ (containers.CCShimsMkLetList_)

Module CCShimsMkLetList_

module type S = sig ... end
module Make (X : sig ... end) : sig ... end
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLetList_/module-type-S/index.html b/dev/containers/CCShimsMkLetList_/module-type-S/index.html deleted file mode 100644 index 678ce4f1..00000000 --- a/dev/containers/CCShimsMkLetList_/module-type-S/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -S (containers.CCShimsMkLetList_.S)

Module type CCShimsMkLetList_.S

val and& : 'a list -> 'b list -> ('a * 'b) list

(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.

# let f xs ys zs =
-    let+ x = xs
-    and& y = ys
-    and& z = zs in
-    x + y + z;;
-val f : int list -> int list -> int list -> int list = <fun>
-# f [1;2] [5;6;7] [10;10];;
-- : int list = [16; 18]
  • since 3.1
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLet_/.dummy b/dev/containers/CCShimsMkLet_/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/containers/CCShimsMkLet_/Make/argument-1-X/index.html b/dev/containers/CCShimsMkLet_/Make/argument-1-X/index.html deleted file mode 100644 index 8075a7f0..00000000 --- a/dev/containers/CCShimsMkLet_/Make/argument-1-X/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -X (containers.CCShimsMkLet_.Make.1-X)

Parameter Make.1-X

type 'a t
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b t
val monoid_product : 'a t -> 'b t -> ('a * 'b) t
val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLet_/Make/index.html b/dev/containers/CCShimsMkLet_/Make/index.html deleted file mode 100644 index 75ed7439..00000000 --- a/dev/containers/CCShimsMkLet_/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (containers.CCShimsMkLet_.Make)

Module CCShimsMkLet_.Make

Parameters

module X : sig ... end

Signature

type 'a t_let = 'a X.t
val let+ : 'a t_let -> ( 'a -> 'b ) -> 'b t_let
val and+ : 'a t_let -> 'b t_let -> ('a * 'b) t_let
val let* : 'a t_let -> ( 'a -> 'b t_let ) -> 'b t_let
val and* : 'a t_let -> 'b t_let -> ('a * 'b) t_let
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLet_/Make2/argument-1-X/index.html b/dev/containers/CCShimsMkLet_/Make2/argument-1-X/index.html deleted file mode 100644 index a9d5235f..00000000 --- a/dev/containers/CCShimsMkLet_/Make2/argument-1-X/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -X (containers.CCShimsMkLet_.Make2.1-X)

Parameter Make2.1-X

type ('a, 'b) t
val (>|=) : ( 'a, 'e ) t -> ( 'a -> 'b ) -> ( 'b, 'e ) t
val monoid_product : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
val (>>=) : ( 'a, 'e ) t -> ( 'a -> ( 'b, 'e ) t ) -> ( 'b, 'e ) t
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLet_/Make2/index.html b/dev/containers/CCShimsMkLet_/Make2/index.html deleted file mode 100644 index d7f2564c..00000000 --- a/dev/containers/CCShimsMkLet_/Make2/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Make2 (containers.CCShimsMkLet_.Make2)

Module CCShimsMkLet_.Make2

Parameters

module X : sig ... end

Signature

type ('a, 'e) t_let2 = ( 'a, 'e ) X.t
val let+ : ( 'a, 'e ) t_let2 -> ( 'a -> 'b ) -> ( 'b, 'e ) t_let2
val and+ : ( 'a, 'e ) t_let2 -> ( 'b, 'e ) t_let2 -> ( 'a * 'b, 'e ) t_let2
val let* : - ( 'a, 'e ) t_let2 -> - ( 'a -> ( 'b, 'e ) t_let2 ) -> - ( 'b, 'e ) t_let2
val and* : ( 'a, 'e ) t_let2 -> ( 'b, 'e ) t_let2 -> ( 'a * 'b, 'e ) t_let2
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLet_/index.html b/dev/containers/CCShimsMkLet_/index.html deleted file mode 100644 index de3da0d4..00000000 --- a/dev/containers/CCShimsMkLet_/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CCShimsMkLet_ (containers.CCShimsMkLet_)

Module CCShimsMkLet_

module type S = sig ... end

glue code for let-operators on OCaml >= 4.08 (auto generated)

module Make (X : sig ... end) : S with type 'a t_let = 'a X.t
module type S2 = sig ... end
module Make2 (X : sig ... end) : S2 with type ('a, 'e) t_let2 = ( 'a, 'e ) X.t
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLet_/module-type-S/index.html b/dev/containers/CCShimsMkLet_/module-type-S/index.html deleted file mode 100644 index 45cfc5d4..00000000 --- a/dev/containers/CCShimsMkLet_/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (containers.CCShimsMkLet_.S)

Module type CCShimsMkLet_.S

glue code for let-operators on OCaml >= 4.08 (auto generated)

type 'a t_let
val let+ : 'a t_let -> ( 'a -> 'b ) -> 'b t_let
val and+ : 'a t_let -> 'b t_let -> ('a * 'b) t_let
val let* : 'a t_let -> ( 'a -> 'b t_let ) -> 'b t_let
val and* : 'a t_let -> 'b t_let -> ('a * 'b) t_let
\ No newline at end of file diff --git a/dev/containers/CCShimsMkLet_/module-type-S2/index.html b/dev/containers/CCShimsMkLet_/module-type-S2/index.html deleted file mode 100644 index e1c0afa2..00000000 --- a/dev/containers/CCShimsMkLet_/module-type-S2/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -S2 (containers.CCShimsMkLet_.S2)

Module type CCShimsMkLet_.S2

type ('a, 'e) t_let2
val let+ : ( 'a, 'e ) t_let2 -> ( 'a -> 'b ) -> ( 'b, 'e ) t_let2
val and+ : ( 'a, 'e ) t_let2 -> ( 'b, 'e ) t_let2 -> ( 'a * 'b, 'e ) t_let2
val let* : - ( 'a, 'e ) t_let2 -> - ( 'a -> ( 'b, 'e ) t_let2 ) -> - ( 'b, 'e ) t_let2
val and* : ( 'a, 'e ) t_let2 -> ( 'b, 'e ) t_let2 -> ( 'a * 'b, 'e ) t_let2
\ No newline at end of file diff --git a/dev/containers/CCMonomorphicShims_/.dummy b/dev/containers/CCShims_syntax/.dummy similarity index 100% rename from dev/containers/CCMonomorphicShims_/.dummy rename to dev/containers/CCShims_syntax/.dummy diff --git a/dev/containers/CCShims_syntax/index.html b/dev/containers/CCShims_syntax/index.html new file mode 100644 index 00000000..7f3fbb8a --- /dev/null +++ b/dev/containers/CCShims_syntax/index.html @@ -0,0 +1,2 @@ + +CCShims_syntax (containers.CCShims_syntax)

Module CCShims_syntax

module type LET = sig ... end

Let operators on OCaml >= 4.08.0, nothing otherwise

\ No newline at end of file diff --git a/dev/containers/CCShims_syntax/module-type-LET/index.html b/dev/containers/CCShims_syntax/module-type-LET/index.html new file mode 100644 index 00000000..eb4bbf68 --- /dev/null +++ b/dev/containers/CCShims_syntax/module-type-LET/index.html @@ -0,0 +1,2 @@ + +LET (containers.CCShims_syntax.LET)

Module type CCShims_syntax.LET

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
type 'a t
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file diff --git a/dev/containers/CCVector/index.html b/dev/containers/CCVector/index.html index 0dd482f4..c07476dc 100644 --- a/dev/containers/CCVector/index.html +++ b/dev/containers/CCVector/index.html @@ -14,4 +14,4 @@ ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> - ( 'a, _ ) t printer

pp ~pp_start ~pp_stop ~pp_sep pp_item ppf v formats the vector v on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : ( 'a, 'e ) t -> ( 'a -> 'b ) -> ( 'b, 'e ) t
val and+ : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
val let* : ( 'a, 'e ) t -> ( 'a -> ( 'b, 'e ) t ) -> ( 'b, 'e ) t
val and* : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
\ No newline at end of file + ( 'a, _ ) t printer

pp ~pp_start ~pp_stop ~pp_sep pp_item ppf v formats the vector v on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").

val let+ : ( 'a, 'e ) t -> ( 'a -> 'b ) -> ( 'b, 'e ) t
  • since 2.8
val and+ : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8
val let* : ( 'a, 'e ) t -> ( 'a -> ( 'b, 'e ) t ) -> ( 'b, 'e ) t
  • since 2.8
val and* : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8
\ No newline at end of file diff --git a/dev/containers/index.html b/dev/containers/index.html index 326bcce4..3ca18436 100644 --- a/dev/containers/index.html +++ b/dev/containers/index.html @@ -1,2 +1,2 @@ -index (containers.index)

containers index

Library containers

This library exposes the following toplevel modules:

Library containers.codegen

The entry point of this library is the module: Containers_codegen.

Library containers.monomorphic

This library exposes the following toplevel modules:

Library containers.top

The entry point of this library is the module: Containers_top.

Library containers.unix

The entry point of this library is the module: CCUnix.

\ No newline at end of file +index (containers.index)

containers index

Library containers

This library exposes the following toplevel modules:

Library containers.codegen

The entry point of this library is the module: Containers_codegen.

Library containers.monomorphic

The entry point of this library is the module: CCMonomorphic.

Library containers.top

The entry point of this library is the module: Containers_top.

Library containers.unix

The entry point of this library is the module: CCUnix.

\ No newline at end of file