From 2c95990690e407b19f56916043f0160f91aea3c5 Mon Sep 17 00:00:00 2001 From: c-cube Date: Wed, 15 Feb 2023 02:05:18 +0000 Subject: [PATCH] deploy: a30e471a6fb6e59fcdbcfef406e577a0b46d69c1 --- dev/containers-data/CCBV/index.html | 2 +- dev/containers-data/CCKTree/Dot/index.html | 2 ++ .../CCKTree/class-type-pset/index.html | 2 ++ dev/containers-data/CCKTree/index.html | 2 +- dev/containers-data/index.html | 2 +- .../CCPool/Make/Fut/Infix/index.html | 2 ++ .../CCPool/Make/Fut/index.html | 2 ++ .../CCPool/Make/argument-1-P/index.html | 2 ++ dev/containers-thread/CCPool/Make/index.html | 2 ++ .../CCPool/module-type-PARAM/index.html | 2 ++ dev/containers/CCArray/Floatarray/index.html | 2 ++ dev/containers/CCArray/Infix/index.html | 2 ++ dev/containers/CCArray/index.html | 2 +- .../CCArray/module-type-MONO_ARRAY/index.html | 2 ++ .../CCArrayLabels/Floatarray/index.html | 2 ++ dev/containers/CCArrayLabels/Infix/index.html | 2 ++ dev/containers/CCArrayLabels/index.html | 2 +- .../module-type-MONO_ARRAY/index.html | 2 ++ .../CCHeap/Make/argument-1-E/index.html | 2 ++ dev/containers/CCHeap/Make/index.html | 7 ++++ .../Make_from_compare/argument-1-E/index.html | 2 ++ .../CCHeap/Make_from_compare/index.html | 7 ++++ .../CCHeap/module-type-PARTIAL_ORD/index.html | 2 ++ .../CCHeap/module-type-S/index.html | 7 ++++ .../CCHeap/module-type-TOTAL_ORD/index.html | 2 ++ dev/containers/CCInt/Infix/index.html | 2 ++ dev/containers/CCList/Assoc/index.html | 7 ++++ dev/containers/CCList/Infix/index.html | 9 +++++ dev/containers/CCList/Ref/index.html | 2 ++ .../CCList/Traverse/argument-1-M/index.html | 2 ++ dev/containers/CCList/Traverse/index.html | 2 ++ .../CCList/module-type-MONAD/index.html | 2 ++ dev/containers/CCListLabels/Assoc/index.html | 7 ++++ dev/containers/CCListLabels/Infix/index.html | 9 +++++ dev/containers/CCListLabels/Ref/index.html | 2 ++ .../Traverse/argument-1-M/index.html | 2 ++ .../CCListLabels/Traverse/index.html | 2 ++ dev/containers/CCListLabels/index.html | 2 +- .../CCListLabels/module-type-MONAD/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/CCParse/Debug_/index.html | 2 ++ dev/containers/CCParse/Error/index.html | 2 ++ dev/containers/CCParse/Infix/index.html | 2 ++ dev/containers/CCParse/Position/index.html | 2 ++ dev/containers/CCParse/Slice/index.html | 2 ++ dev/containers/CCParse/U/index.html | 15 +++++++++ dev/containers/CCParse/index.html | 4 +-- dev/containers/CCSeq/Infix/index.html | 2 ++ .../CCSeq/Traverse/argument-1-M/index.html | 2 ++ dev/containers/CCSeq/Traverse/index.html | 2 ++ dev/containers/CCSeq/index.html | 2 +- .../CCSeq/module-type-MONAD/index.html | 2 ++ .../CCShims_syntax/module-type-LET/index.html | 2 ++ dev/containers/CCString/Find/index.html | 2 ++ dev/containers/CCString/Infix/index.html | 2 ++ dev/containers/CCString/Split/index.html | 18 ++++++++++ dev/containers/CCStringLabels/Find/index.html | 2 ++ .../CCStringLabels/Infix/index.html | 2 ++ .../CCStringLabels/Split/index.html | 18 ++++++++++ .../Containers/Hashtbl/Make/index.html | 2 ++ .../MakeSeeded/argument-1-H/index.html | 2 ++ .../Containers/Hashtbl/MakeSeeded/index.html | 2 ++ dev/containers/Containers/Hashtbl/index.html | 33 +++++++++++++++++++ .../Hashtbl/module-type-HashedType/index.html | 2 ++ .../Hashtbl/module-type-S/index.html | 2 ++ .../module-type-SeededHashedType/index.html | 2 ++ .../Hashtbl/module-type-SeededS/index.html | 2 ++ .../ContainersLabels/Hashtbl/Make/index.html | 2 ++ .../MakeSeeded/argument-1-H/index.html | 2 ++ .../Hashtbl/MakeSeeded/index.html | 2 ++ .../ContainersLabels/Hashtbl/index.html | 33 +++++++++++++++++++ .../Hashtbl/module-type-HashedType/index.html | 2 ++ .../Hashtbl/module-type-S/index.html | 2 ++ .../module-type-SeededHashedType/index.html | 2 ++ .../Hashtbl/module-type-SeededS/index.html | 2 ++ 78 files changed, 293 insertions(+), 11 deletions(-) create mode 100644 dev/containers-data/CCKTree/Dot/index.html create mode 100644 dev/containers-data/CCKTree/class-type-pset/index.html create mode 100644 dev/containers-thread/CCPool/Make/Fut/Infix/index.html create mode 100644 dev/containers-thread/CCPool/Make/Fut/index.html create mode 100644 dev/containers-thread/CCPool/Make/argument-1-P/index.html create mode 100644 dev/containers-thread/CCPool/Make/index.html create mode 100644 dev/containers-thread/CCPool/module-type-PARAM/index.html create mode 100644 dev/containers/CCArray/Floatarray/index.html create mode 100644 dev/containers/CCArray/Infix/index.html create mode 100644 dev/containers/CCArray/module-type-MONO_ARRAY/index.html create mode 100644 dev/containers/CCArrayLabels/Floatarray/index.html create mode 100644 dev/containers/CCArrayLabels/Infix/index.html create mode 100644 dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html create mode 100644 dev/containers/CCHeap/Make/argument-1-E/index.html create mode 100644 dev/containers/CCHeap/Make/index.html create mode 100644 dev/containers/CCHeap/Make_from_compare/argument-1-E/index.html create mode 100644 dev/containers/CCHeap/Make_from_compare/index.html create mode 100644 dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html create mode 100644 dev/containers/CCHeap/module-type-S/index.html create mode 100644 dev/containers/CCHeap/module-type-TOTAL_ORD/index.html create mode 100644 dev/containers/CCInt/Infix/index.html create mode 100644 dev/containers/CCList/Assoc/index.html create mode 100644 dev/containers/CCList/Infix/index.html create mode 100644 dev/containers/CCList/Ref/index.html create mode 100644 dev/containers/CCList/Traverse/argument-1-M/index.html create mode 100644 dev/containers/CCList/Traverse/index.html create mode 100644 dev/containers/CCList/module-type-MONAD/index.html create mode 100644 dev/containers/CCListLabels/Assoc/index.html create mode 100644 dev/containers/CCListLabels/Infix/index.html create mode 100644 dev/containers/CCListLabels/Ref/index.html create mode 100644 dev/containers/CCListLabels/Traverse/argument-1-M/index.html create mode 100644 dev/containers/CCListLabels/Traverse/index.html create mode 100644 dev/containers/CCListLabels/module-type-MONAD/index.html create mode 100644 dev/containers/CCOpt/Infix/index.html create mode 100644 dev/containers/CCOption/Infix/index.html create mode 100644 dev/containers/CCParse/Debug_/index.html create mode 100644 dev/containers/CCParse/Error/index.html create mode 100644 dev/containers/CCParse/Infix/index.html create mode 100644 dev/containers/CCParse/Position/index.html create mode 100644 dev/containers/CCParse/Slice/index.html create mode 100644 dev/containers/CCParse/U/index.html create mode 100644 dev/containers/CCSeq/Infix/index.html create mode 100644 dev/containers/CCSeq/Traverse/argument-1-M/index.html create mode 100644 dev/containers/CCSeq/Traverse/index.html create mode 100644 dev/containers/CCSeq/module-type-MONAD/index.html create mode 100644 dev/containers/CCShims_syntax/module-type-LET/index.html create mode 100644 dev/containers/CCString/Find/index.html create mode 100644 dev/containers/CCString/Infix/index.html create mode 100644 dev/containers/CCString/Split/index.html create mode 100644 dev/containers/CCStringLabels/Find/index.html create mode 100644 dev/containers/CCStringLabels/Infix/index.html create mode 100644 dev/containers/CCStringLabels/Split/index.html create mode 100644 dev/containers/Containers/Hashtbl/Make/index.html create mode 100644 dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html create mode 100644 dev/containers/Containers/Hashtbl/MakeSeeded/index.html create mode 100644 dev/containers/Containers/Hashtbl/index.html create mode 100644 dev/containers/Containers/Hashtbl/module-type-HashedType/index.html create mode 100644 dev/containers/Containers/Hashtbl/module-type-S/index.html create mode 100644 dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html create mode 100644 dev/containers/Containers/Hashtbl/module-type-SeededS/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/Make/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/MakeSeeded/argument-1-H/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/module-type-S/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/module-type-SeededHashedType/index.html create mode 100644 dev/containers/ContainersLabels/Hashtbl/module-type-SeededS/index.html diff --git a/dev/containers-data/CCBV/index.html b/dev/containers-data/CCBV/index.html index 7c7277ea..3bbfcaae 100644 --- a/dev/containers-data/CCBV/index.html +++ b/dev/containers-data/CCBV/index.html @@ -1,3 +1,3 @@ CCBV (containers-data.CCBV)

Module CCBV

Imperative Bitvectors.

A bitvector is stored in some form of internal array (on the heap). Is it a bit similar to a more storage-efficient version of bool - CCVector.vector, with additional operations.

BREAKING CHANGES since 1.2: size is now stored along with the bitvector. Some functions have a new signature.

The size of the bitvector used to be rounded up to the multiple of 30 or 62. In other words some functions such as iter would iterate on more bits than what was originally asked for. This is not the case anymore.

type t

A resizable bitvector

val empty : unit -> t

Empty bitvector. Length is 0.

val create : size:int -> bool -> t

Create a bitvector of given size, with given default value. Length of result is size.

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

init len f initializes a bitvector of length len, where bit i is true iff f i is.

  • since 3.9
val copy : t -> t

Copy of bitvector.

val cardinal : t -> int

Number of bits set to one, seen as a set of bits.

val length : t -> int

Size of underlying bitvector. This is not related to the underlying implementation. Changed at 1.2

val capacity : t -> int

The number of bits this bitvector can store without resizing.

  • since 1.2
val resize : t -> int -> unit

Resize the BV so that it has the specified length. This can grow the underlying array, but it will not shrink it, to minimize memory traffic.

  • raises Invalid_argument

    on negative sizes.

val resize_minimize_memory : t -> int -> unit

Same as resize, but this can also shrink the underlying array if this reduces the size.

  • raises Invalid_argument

    on negative sizes.

  • since 3.9
val is_empty : t -> bool

Are there any true bits?

val set : t -> int -> unit

Set i-th bit, extending the bitvector if needed.

val get : t -> int -> bool

Is the i-th bit true? Return false if the index is too high.

val reset : t -> int -> unit

Set i-th bit to 0, extending the bitvector if needed.

val set_bool : t -> int -> bool -> unit

Set or reset i-th bit.

  • since 3.9
val flip : t -> int -> unit

Flip i-th bit, extending the bitvector if needed.

val clear : t -> unit

Set every bit to 0. Does not change the length.

val clear_and_shrink : t -> unit

Set every bit to 0, and set length to 0.

  • since 3.9
val iter : t -> (int -> bool -> unit) -> unit

Iterate on all bits.

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

Iterate on bits set to 1.

val to_list : t -> int list

List of indexes that are true.

val to_sorted_list : t -> int list

Same as to_list, but also guarantees the list is sorted in increasing order.

val of_list : int list -> t

From a list of true bits.

The bits are interpreted as indices into the returned bitvector, so the final bitvector bv will have length bv equal to 1 more than max of list indices.

val first : t -> int option

First set bit, or return None. Changed type at 1.2

val first_exn : t -> int

First set bit, or

  • raises Not_found

    if all bits are 0.

  • since 1.2
val filter : t -> (int -> bool) -> unit

filter bv p only keeps the true bits of bv whose index satisfies p index. Length is unchanged.

val negate_self : t -> unit

negate_self t flips all of the bits in t. Length is unchanged.

  • since 1.2
val negate : t -> t

negate t returns a copy of t with all of the bits flipped. Length is unchanged.

val union_into : into:t -> t -> unit

union_into ~into bv sets into to the union of itself and bv. Also updates the length of into to be at least length bv.

val inter_into : into:t -> t -> unit

inter_into ~into bv sets into to the intersection of itself and bv. Also updates the length of into to be at most length bv.

After executing:

  • length ~into' = min (length into) (length bv).
  • for all i: get into' ==> get into i /\ get bv i
val union : t -> t -> t

union bv1 bv2 returns the union of the two sets. The length of the result is the max of the inputs' lengths.

val inter : t -> t -> t

inter bv1 bv2 returns the intersection of the two sets. The length of the result is the min of the inputs' lengths.

val diff_into : into:t -> t -> unit

diff_into ~into t modifies into with only the bits set but not in t.

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

diff t1 t2 returns those bits found in t1 but not in t2.

  • since 1.2
val select : t -> 'a array -> 'a list

select arr bv selects the elements of arr whose index corresponds to a true bit in bv. If bv is too short, elements of arr with too high an index cannot be selected and are therefore not selected.

val selecti : t -> 'a array -> ('a * int) list

Same as select, but selected elements are paired with their indexes.

val equal : t -> t -> bool

Bitwise comparison, including the size (equal a b implies length a=length b).

  • since 3.5
type 'a iter = ('a -> unit) -> unit
val to_iter : t -> int iter

Iterate over the true bits.

val of_iter : int iter -> t

Build from true bits.

val pp : Stdlib.Format.formatter -> t -> unit

Print the bitvector as a string of bits.

  • since 0.13
\ No newline at end of file + CCVector.vector, with additional operations.

BREAKING CHANGES since 1.2: size is now stored along with the bitvector. Some functions have a new signature.

The size of the bitvector used to be rounded up to the multiple of 30 or 62. In other words some functions such as iter would iterate on more bits than what was originally asked for. This is not the case anymore.

type t

A resizable bitvector

val empty : unit -> t

Empty bitvector. Length is 0.

val create : size:int -> bool -> t

Create a bitvector of given size, with given default value. Length of result is size.

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

init len f initializes a bitvector of length len, where bit i is true iff f i is.

  • since 3.9
val copy : t -> t

Copy of bitvector.

val cardinal : t -> int

Number of bits set to one, seen as a set of bits.

val length : t -> int

Size of underlying bitvector. This is not related to the underlying implementation. Changed at 1.2

val capacity : t -> int

The number of bits this bitvector can store without resizing.

  • since 1.2
val resize : t -> int -> unit

Resize the BV so that it has the specified length. This can grow the underlying array, but it will not shrink it, to minimize memory traffic.

  • raises Invalid_argument

    on negative sizes.

val resize_minimize_memory : t -> int -> unit

Same as resize, but this can also shrink the underlying array if this reduces the size.

  • raises Invalid_argument

    on negative sizes.

  • since 3.9
val is_empty : t -> bool

Are there any true bits?

val set : t -> int -> unit

Set i-th bit, extending the bitvector if needed.

val get : t -> int -> bool

Is the i-th bit true? Return false if the index is too high.

val reset : t -> int -> unit

Set i-th bit to 0, extending the bitvector if needed.

val set_bool : t -> int -> bool -> unit

Set or reset i-th bit.

  • since 3.9
val flip : t -> int -> unit

Flip i-th bit, extending the bitvector if needed.

val clear : t -> unit

Set every bit to 0. Does not change the length.

val clear_and_shrink : t -> unit

Set every bit to 0, and set length to 0.

  • since 3.9
val iter : t -> (int -> bool -> unit) -> unit

Iterate on all bits.

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

Iterate on bits set to 1.

val to_list : t -> int list

List of indexes that are true.

val to_sorted_list : t -> int list

Same as to_list, but also guarantees the list is sorted in increasing order.

val of_list : int list -> t

From a list of true bits.

The bits are interpreted as indices into the returned bitvector, so the final bitvector bv will have length bv equal to 1 more than max of list indices.

val first : t -> int option

First set bit, or return None. Changed type at 1.2

val first_exn : t -> int

First set bit, or

  • raises Not_found

    if all bits are 0.

  • since 1.2
val filter : t -> (int -> bool) -> unit

filter bv p only keeps the true bits of bv whose index satisfies p index. Length is unchanged.

val negate_self : t -> unit

negate_self t flips all of the bits in t. Length is unchanged.

  • since 1.2
val negate : t -> t

negate t returns a copy of t with all of the bits flipped. Length is unchanged.

val union_into : into:t -> t -> unit

union_into ~into bv sets into to the union of itself and bv. Also updates the length of into to be at least length bv.

val inter_into : into:t -> t -> unit

inter_into ~into bv sets into to the intersection of itself and bv. Also updates the length of into to be at most length bv.

After executing:

  • length ~into' = min (length into) (length bv).
  • for all i: get into' ==> get into i /\ get bv i
val union : t -> t -> t

union bv1 bv2 returns the union of the two sets. The length of the result is the max of the inputs' lengths.

val inter : t -> t -> t

inter bv1 bv2 returns the intersection of the two sets. The length of the result is the min of the inputs' lengths.

val diff_into : into:t -> t -> unit

diff_into ~into t modifies into with only the bits set but not in t.

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

diff t1 t2 returns those bits found in t1 but not in t2.

  • since 1.2
val select : t -> 'a array -> 'a list

select arr bv selects the elements of arr whose index corresponds to a true bit in bv. If bv is too short, elements of arr with too high an index cannot be selected and are therefore not selected.

val selecti : t -> 'a array -> ('a * int) list

Same as select, but selected elements are paired with their indexes.

val equal : t -> t -> bool

Bitwise comparison, including the size (equal a b implies length a=length b).

  • since 3.5
type 'a iter = ('a -> unit) -> unit
val to_iter : t -> int iter

Iterate over the true bits.

val of_iter : int iter -> t

Build from true bits.

val pp : Stdlib.Format.formatter -> t -> unit

Print the bitvector as a string of bits.

  • since 0.13
\ No newline at end of file diff --git a/dev/containers-data/CCKTree/Dot/index.html b/dev/containers-data/CCKTree/Dot/index.html new file mode 100644 index 00000000..a404aed2 --- /dev/null +++ b/dev/containers-data/CCKTree/Dot/index.html @@ -0,0 +1,2 @@ + +Dot (containers-data.CCKTree.Dot)

Module CCKTree.Dot

type attribute = [
  1. | `Color of string
  2. | `Shape of string
  3. | `Weight of int
  4. | `Style of string
  5. | `Label of string
  6. | `Id of string
    (*

    Unique ID in the graph. Allows sharing.

    *)
  7. | `Other of string * string
]

Dot attributes for nodes

type graph = string * attribute list t list

A dot graph is a name, plus a list of trees labelled with attributes

val mk_id : ('a, Stdlib.Buffer.t, unit, attribute) Stdlib.format4 -> 'a

Using a formatter string, build an ID.

val mk_label : ('a, Stdlib.Buffer.t, unit, attribute) Stdlib.format4 -> 'a

Using a formatter string, build a label.

val make : name:string -> attribute list t list -> graph
val singleton : name:string -> attribute list t -> graph
val pp_single : string -> attribute list t printer
val pp : graph printer

Printer to DOT with indentation, etc.

  • since 0.6.1
val print_to_file : string -> graph -> unit

print_to_file filename g prints g into a file whose name is filename.

  • since 0.6.1
val to_file : ?name:string -> string -> attribute list t list -> unit

to_file filename trees makes a graph out of the trees, opens the file filename and prints the graph into the file.

  • parameter name

    name of the graph.

  • since 0.6.1
\ No newline at end of file diff --git a/dev/containers-data/CCKTree/class-type-pset/index.html b/dev/containers-data/CCKTree/class-type-pset/index.html new file mode 100644 index 00000000..d15f802c --- /dev/null +++ b/dev/containers-data/CCKTree/class-type-pset/index.html @@ -0,0 +1,2 @@ + +pset (containers-data.CCKTree.pset)

Class type CCKTree.pset

Abstract Set structure

method add : 'a -> 'a pset
method mem : 'a -> bool
\ No newline at end of file diff --git a/dev/containers-data/CCKTree/index.html b/dev/containers-data/CCKTree/index.html index 3b7b90f0..ec2dafb0 100644 --- a/dev/containers-data/CCKTree/index.html +++ b/dev/containers-data/CCKTree/index.html @@ -1,5 +1,5 @@ -CCKTree (containers-data.CCKTree)

Module CCKTree

Lazy Tree Structure This structure can be used to represent trees and directed graphs (as infinite trees) in a lazy fashion. Like CCKList, it is a structural type.

type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type +'a t = unit -> [ `Nil | `Node of 'a * 'a t list ]
val empty : 'a t
val is_empty : _ t -> bool
val singleton : 'a -> 'a t

Tree with only one label.

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

Build a node from a label and a list of children.

val node1 : 'a -> 'a t -> 'a t

Node with one child.

val node2 : 'a -> 'a t -> 'a t -> 'a t

Node with two children.

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

Fold on values in no specified order. May not terminate if the tree is infinite.

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

Number of elements.

val height : _ t -> int

Length of the longest path to empty leaves.

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

Cut the tree at the given depth, so it becomes finite.

Graph Traversals

class type 'a pset = object ... end

Abstract Set structure

val set_of_cmp : cmp:('a -> 'a -> int) -> unit -> 'a pset

Build a set structure given a total ordering.

val dfs : pset:'a pset -> 'a t -> [ `Enter of 'a | `Exit of 'a ] Stdlib.Seq.t

Depth-first traversal of the tree.

val bfs : pset:'a pset -> 'a t -> 'a Stdlib.Seq.t

Breadth-first traversal of the tree.

val force : 'a t -> [ `Nil | `Node of 'a * 'b list ] as 'b

force t evaluates t completely and returns a regular tree structure.

  • since 0.13
val find : pset:'a pset -> ('a -> 'b option) -> 'a t -> 'b option

Look for an element that maps to Some _.

Pretty-printing

Example (tree of calls for naive Fibonacci function):

let mk_fib n =
+CCKTree (containers-data.CCKTree)

Module CCKTree

Lazy Tree Structure This structure can be used to represent trees and directed graphs (as infinite trees) in a lazy fashion. It is a structural type.

type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type +'a t = unit -> [ `Nil | `Node of 'a * 'a t list ]
val empty : 'a t
val is_empty : _ t -> bool
val singleton : 'a -> 'a t

Tree with only one label.

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

Build a node from a label and a list of children.

val node1 : 'a -> 'a t -> 'a t

Node with one child.

val node2 : 'a -> 'a t -> 'a t -> 'a t

Node with two children.

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

Fold on values in no specified order. May not terminate if the tree is infinite.

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

Number of elements.

val height : _ t -> int

Length of the longest path to empty leaves.

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

Cut the tree at the given depth, so it becomes finite.

Graph Traversals

class type 'a pset = object ... end

Abstract Set structure

val set_of_cmp : cmp:('a -> 'a -> int) -> unit -> 'a pset

Build a set structure given a total ordering.

val dfs : pset:'a pset -> 'a t -> [ `Enter of 'a | `Exit of 'a ] Stdlib.Seq.t

Depth-first traversal of the tree.

val bfs : pset:'a pset -> 'a t -> 'a Stdlib.Seq.t

Breadth-first traversal of the tree.

val force : 'a t -> [ `Nil | `Node of 'a * 'b list ] as 'b

force t evaluates t completely and returns a regular tree structure.

  • since 0.13
val find : pset:'a pset -> ('a -> 'b option) -> 'a t -> 'b option

Look for an element that maps to Some _.

Pretty-printing

Example (tree of calls for naive Fibonacci function):

let mk_fib n =
   let rec fib' l r i =
     if i=n then r else fib' r (l+r) (i+1)
   in fib' 1 1 1;;
diff --git a/dev/containers-data/index.html b/dev/containers-data/index.html
index bf1e69fa..07d153ed 100644
--- a/dev/containers-data/index.html
+++ b/dev/containers-data/index.html
@@ -1,2 +1,2 @@
 
-index (containers-data.index)

containers-data index

Library containers-data

This library exposes the following toplevel modules:

Library containers-data.top

The entry point of this library is the module: Containers_data_top.

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

containers-data index

Library containers-data

This library exposes the following toplevel modules:

Library containers-data.top

The entry point of this library is the module: Containers_data_top.

\ 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 new file mode 100644 index 00000000..bc28a1da --- /dev/null +++ b/dev/containers-thread/CCPool/Make/Fut/Infix/index.html @@ -0,0 +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 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 new file mode 100644 index 00000000..532ef898 --- /dev/null +++ b/dev/containers-thread/CCPool/Make/Fut/index.html @@ -0,0 +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
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-thread/CCPool/Make/argument-1-P/index.html b/dev/containers-thread/CCPool/Make/argument-1-P/index.html new file mode 100644 index 00000000..151f5358 --- /dev/null +++ b/dev/containers-thread/CCPool/Make/argument-1-P/index.html @@ -0,0 +1,2 @@ + +P (containers-thread.CCPool.Make.P)

Parameter Make.P

val max_size : int

Maximum number of threads in the pool.

\ No newline at end of file diff --git a/dev/containers-thread/CCPool/Make/index.html b/dev/containers-thread/CCPool/Make/index.html new file mode 100644 index 00000000..4d36a993 --- /dev/null +++ b/dev/containers-thread/CCPool/Make/index.html @@ -0,0 +1,2 @@ + +Make (containers-thread.CCPool.Make)

Module CCPool.Make

Create a new Pool

Parameters

module P : PARAM

Signature

val run : (unit -> _) -> unit

run f schedules f for being executed in the thread pool.

val run1 : ('a -> _) -> 'a -> unit

run1 f x is similar to run (fun () -> f x).

val run2 : ('a -> 'b -> _) -> 'a -> 'b -> unit
val run3 : ('a -> 'b -> 'c -> _) -> 'a -> 'b -> 'c -> unit
val set_exn_handler : (exn -> unit) -> unit
val active : unit -> bool

active () is true as long as stop() has not been called yet.

val stop : unit -> unit

After calling stop (), most functions will raise Stopped. This has the effect of preventing new tasks from being executed.

module Fut : sig ... end
\ No newline at end of file diff --git a/dev/containers-thread/CCPool/module-type-PARAM/index.html b/dev/containers-thread/CCPool/module-type-PARAM/index.html new file mode 100644 index 00000000..f1bcd6f1 --- /dev/null +++ b/dev/containers-thread/CCPool/module-type-PARAM/index.html @@ -0,0 +1,2 @@ + +PARAM (containers-thread.CCPool.PARAM)

Module type CCPool.PARAM

val max_size : int

Maximum number of threads in the pool.

\ 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..23dcbc02 --- /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/Infix/index.html b/dev/containers/CCArray/Infix/index.html new file mode 100644 index 00000000..44ef72f4 --- /dev/null +++ b/dev/containers/CCArray/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCArray.Infix)

Module CCArray.Infix

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

a >>= f is the infix version of flat_map.

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

a >>| f is the infix version of map.

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

a >|= f is the infix version of map.

  • since 0.8
val (--) : int -> int -> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

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

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a array -> ('a -> 'b) -> 'b array
val and+ : 'a array -> 'b array -> ('a * 'b) array
val let* : 'a array -> ('a -> 'b array) -> 'b array
val and* : 'a array -> 'b array -> ('a * 'b) array
\ No newline at end of file diff --git a/dev/containers/CCArray/index.html b/dev/containers/CCArray/index.html index dabbf780..fa869623 100644 --- a/dev/containers/CCArray/index.html +++ b/dev/containers/CCArray/index.html @@ -17,4 +17,4 @@ (module MONO_ARRAY with type elt = 'elt and type t = 'arr) -> cmp:('elt -> 'elt -> int) -> 'arr -> - unit

sort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.

  • since 0.14

Infix Operators

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

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

a >>= f is the infix version of flat_map.

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

a >>| f is the infix version of map.

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

a >|= f is the infix version of map.

  • since 0.8
val (--) : int -> int -> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

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

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a array -> ('a -> 'b) -> 'b array
val and+ : 'a array -> 'b array -> ('a * 'b) array
val let* : 'a array -> ('a -> 'b array) -> 'b array
val and* : 'a array -> 'b array -> ('a * 'b) array
\ No newline at end of file + unit

sort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.

Infix Operators

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

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

a >>= f is the infix version of flat_map.

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

a >>| f is the infix version of map.

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

a >|= f is the infix version of map.

  • since 0.8
val (--) : int -> int -> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

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

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a array -> ('a -> 'b) -> 'b array
val and+ : 'a array -> 'b array -> ('a * 'b) array
val let* : 'a array -> ('a -> 'b array) -> 'b array
val and* : 'a array -> 'b array -> ('a * 'b) array
\ No newline at end of file diff --git a/dev/containers/CCArray/module-type-MONO_ARRAY/index.html b/dev/containers/CCArray/module-type-MONO_ARRAY/index.html new file mode 100644 index 00000000..db60b62c --- /dev/null +++ b/dev/containers/CCArray/module-type-MONO_ARRAY/index.html @@ -0,0 +1,2 @@ + +MONO_ARRAY (containers.CCArray.MONO_ARRAY)

Module type CCArray.MONO_ARRAY

type elt
type t
val length : t -> int
val get : t -> int -> elt
val set : t -> int -> elt -> unit
\ No newline at end of file diff --git a/dev/containers/CCArrayLabels/Floatarray/index.html b/dev/containers/CCArrayLabels/Floatarray/index.html new file mode 100644 index 00000000..fdba03d7 --- /dev/null +++ b/dev/containers/CCArrayLabels/Floatarray/index.html @@ -0,0 +1,2 @@ + +Floatarray (containers.CCArrayLabels.Floatarray)

Module CCArrayLabels.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/CCArrayLabels/Infix/index.html b/dev/containers/CCArrayLabels/Infix/index.html new file mode 100644 index 00000000..ae78c560 --- /dev/null +++ b/dev/containers/CCArrayLabels/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCArrayLabels.Infix)

Module CCArrayLabels.Infix

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

a >>= f is the infix version of flat_map.

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

a >>| f is the infix version of map.

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

a >|= f is the infix version of map.

  • since 0.8
val (--) : int -> int -> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

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

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a array -> ('a -> 'b) -> 'b array
val and+ : 'a array -> 'b array -> ('a * 'b) array
val let* : 'a array -> ('a -> 'b array) -> 'b array
val and* : 'a array -> 'b array -> ('a * 'b) array
\ No newline at end of file diff --git a/dev/containers/CCArrayLabels/index.html b/dev/containers/CCArrayLabels/index.html index 685e2c19..b6f2cf90 100644 --- a/dev/containers/CCArrayLabels/index.html +++ b/dev/containers/CCArrayLabels/index.html @@ -31,4 +31,4 @@ (module MONO_ARRAY with type elt = 'elt and type t = 'arr) -> cmp:('elt -> 'elt -> int) -> 'arr -> - unit

sort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.

Infix Operators

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

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

a >>= f is the infix version of flat_map.

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

a >>| f is the infix version of map.

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

a >|= f is the infix version of map.

  • since 0.8
val (--) : int -> int -> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

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

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a array -> ('a -> 'b) -> 'b array
val and+ : 'a array -> 'b array -> ('a * 'b) array
val let* : 'a array -> ('a -> 'b array) -> 'b array
val and* : 'a array -> 'b array -> ('a * 'b) array
\ No newline at end of file + unit

sort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.

Infix Operators

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

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

a >>= f is the infix version of flat_map.

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

a >>| f is the infix version of map.

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

a >|= f is the infix version of map.

  • since 0.8
val (--) : int -> int -> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

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

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • since 0.17

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a array -> ('a -> 'b) -> 'b array
val and+ : 'a array -> 'b array -> ('a * 'b) array
val let* : 'a array -> ('a -> 'b array) -> 'b array
val and* : 'a array -> 'b array -> ('a * 'b) array
\ No newline at end of file diff --git a/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html b/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html new file mode 100644 index 00000000..a06769e6 --- /dev/null +++ b/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html @@ -0,0 +1,2 @@ + +MONO_ARRAY (containers.CCArrayLabels.MONO_ARRAY)

Module type CCArrayLabels.MONO_ARRAY

type elt
type t
val length : t -> int
val get : t -> int -> elt
val set : t -> int -> elt -> unit
\ No newline at end of file diff --git a/dev/containers/CCHeap/Make/argument-1-E/index.html b/dev/containers/CCHeap/Make/argument-1-E/index.html new file mode 100644 index 00000000..ae07253c --- /dev/null +++ b/dev/containers/CCHeap/Make/argument-1-E/index.html @@ -0,0 +1,2 @@ + +E (containers.CCHeap.Make.E)

Parameter Make.E

type t
val leq : t -> t -> bool

leq x y shall return true iff x is lower or equal to y.

\ No newline at end of file diff --git a/dev/containers/CCHeap/Make/index.html b/dev/containers/CCHeap/Make/index.html new file mode 100644 index 00000000..0b71b56b --- /dev/null +++ b/dev/containers/CCHeap/Make/index.html @@ -0,0 +1,7 @@ + +Make (containers.CCHeap.Make)

Module CCHeap.Make

Parameters

module E : PARTIAL_ORD

Signature

type elt = E.t
type t
val empty : t

empty returns the empty heap.

val is_empty : t -> bool

is_empty h returns true if the heap h is empty.

exception Empty
val merge : t -> t -> t

merge h1 h2 merges the two heaps h1 and h2.

val insert : elt -> t -> t

insert x h inserts an element x into the heap h.

val add : t -> elt -> t

add h x inserts an element x into the heap h.

val filter : (elt -> bool) -> t -> t

filter p h filters values, only retaining the ones that satisfy the predicate p. Linear time at least.

val find_min : t -> elt option

find_min h find the minimal element of the heap h.

val find_min_exn : t -> elt

find_min_exn h is like find_min but can fail.

  • raises Empty

    if the heap is empty.

val take : t -> (t * elt) option

take h extracts and returns the minimum element, and the new heap (without this element), or None if the heap h is empty.

val take_exn : t -> t * elt

take_exn h is like take, but can fail.

  • raises Empty

    if the heap is empty.

val delete_one : (elt -> elt -> bool) -> elt -> t -> t

delete_one eq x h uses eq to find one occurrence of a value x if it exist in the heap h, and delete it. If h do not contain x then it return h.

  • since 2.0
val delete_all : (elt -> elt -> bool) -> elt -> t -> t

delete_all eq x h uses eq to find all x in h and delete them. If h do not contain x then it return h. The difference with filter is that delete_all stops as soon as it enters a subtree whose root is bigger than the element.

  • since 2.0
val iter : (elt -> unit) -> t -> unit

iter f h iterates over the heap h invoking f with the current element.

val fold : ('a -> elt -> 'a) -> 'a -> t -> 'a

fold f acc h folds on all values of h.

val size : t -> int

size h is the number of elements in the heap h. Linear complexity.

Conversions

val to_list : t -> elt list

to_list h returns the elements of the heap h, in no particular order.

val to_list_sorted : t -> elt list

to_list_sorted h returns the elements of the heap h in increasing order.

  • since 1.1
val add_list : t -> elt list -> t

add_list h l adds the elements of the list l into the heap h. An element occurring several times will be added that many times to the heap.

  • since 0.16
val of_list : elt list -> t

of_list l is add_list empty l. Complexity: O(n log n).

val add_iter : t -> elt iter -> t

add_iter h iter is like add_list.

  • since 2.8
val add_seq : t -> elt Stdlib.Seq.t -> t

add_seq h seq is like add_list. Renamed from add_std_seq since 3.0.

  • since 3.0
val of_iter : elt iter -> t

of_iter iter builds a heap from a given iter. Complexity: O(n log n).

  • since 2.8
val of_seq : elt Stdlib.Seq.t -> t

of_seq seq builds a heap from a given Seq.t. Complexity: O(n log n). Renamed from of_seq since 3.0.

  • since 3.0
val to_iter : t -> elt iter

to_iter h returns a iter of the elements of the heap h.

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

to_seq h returns a Seq.t of the elements of the heap h. Renamed from to_std_seq since 3.0.

  • since 3.0
val to_iter_sorted : t -> elt iter

to_iter_sorted h returns a iter by iterating on the elements of h, in increasing order.

  • since 2.8
val to_seq_sorted : t -> elt Stdlib.Seq.t

to_seq_sorted h returns a Seq.t by iterating on the elements of h, in increasing order. Renamed from to_std_seq_sorted since 3.0.

  • since 3.0
val add_gen : t -> elt gen -> t

add_gen h gen adds the gen gen to the heap h.

  • since 0.16
val of_gen : elt gen -> t

of_gen gen builds a heap from a given gen. Complexity: O(n log n).

val to_gen : t -> elt gen

to_gen h returns a gen of the elements of the heap h.

val to_tree : t -> elt ktree

to_tree h returns a ktree of the elements of the heap h.

val to_string : ?sep:string -> (elt -> string) -> t -> string

to_string ?sep f h prints the heap h in a string using sep as a given separator (default ",") between each element (converted to a string using f).

  • since 2.7
val pp : + ?pp_start:unit printer -> + ?pp_stop:unit printer -> + ?pp_sep:unit printer -> + elt printer -> + t printer

pp ?pp_start ?pp_stop ?pp_sep ppf h prints h on ppf. Each element is formatted with ppf, 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 ",@ "). Renamed from print since 2.0

  • since 0.16
\ No newline at end of file diff --git a/dev/containers/CCHeap/Make_from_compare/argument-1-E/index.html b/dev/containers/CCHeap/Make_from_compare/argument-1-E/index.html new file mode 100644 index 00000000..38580163 --- /dev/null +++ b/dev/containers/CCHeap/Make_from_compare/argument-1-E/index.html @@ -0,0 +1,2 @@ + +E (containers.CCHeap.Make_from_compare.E)

Parameter Make_from_compare.E

type t
val compare : t -> t -> int

compare a b shall return a negative value if a is smaller than b, 0 if a and b are equal or a positive value if a is greater than b

\ No newline at end of file diff --git a/dev/containers/CCHeap/Make_from_compare/index.html b/dev/containers/CCHeap/Make_from_compare/index.html new file mode 100644 index 00000000..affc433d --- /dev/null +++ b/dev/containers/CCHeap/Make_from_compare/index.html @@ -0,0 +1,7 @@ + +Make_from_compare (containers.CCHeap.Make_from_compare)

Module CCHeap.Make_from_compare

A convenient version of Make that take a TOTAL_ORD instead of a partially ordered module. It allow to directly pass modules that implement compare without implementing leq explicitly

Parameters

module E : TOTAL_ORD

Signature

type elt = E.t
type t
val empty : t

empty returns the empty heap.

val is_empty : t -> bool

is_empty h returns true if the heap h is empty.

exception Empty
val merge : t -> t -> t

merge h1 h2 merges the two heaps h1 and h2.

val insert : elt -> t -> t

insert x h inserts an element x into the heap h.

val add : t -> elt -> t

add h x inserts an element x into the heap h.

val filter : (elt -> bool) -> t -> t

filter p h filters values, only retaining the ones that satisfy the predicate p. Linear time at least.

val find_min : t -> elt option

find_min h find the minimal element of the heap h.

val find_min_exn : t -> elt

find_min_exn h is like find_min but can fail.

  • raises Empty

    if the heap is empty.

val take : t -> (t * elt) option

take h extracts and returns the minimum element, and the new heap (without this element), or None if the heap h is empty.

val take_exn : t -> t * elt

take_exn h is like take, but can fail.

  • raises Empty

    if the heap is empty.

val delete_one : (elt -> elt -> bool) -> elt -> t -> t

delete_one eq x h uses eq to find one occurrence of a value x if it exist in the heap h, and delete it. If h do not contain x then it return h.

  • since 2.0
val delete_all : (elt -> elt -> bool) -> elt -> t -> t

delete_all eq x h uses eq to find all x in h and delete them. If h do not contain x then it return h. The difference with filter is that delete_all stops as soon as it enters a subtree whose root is bigger than the element.

  • since 2.0
val iter : (elt -> unit) -> t -> unit

iter f h iterates over the heap h invoking f with the current element.

val fold : ('a -> elt -> 'a) -> 'a -> t -> 'a

fold f acc h folds on all values of h.

val size : t -> int

size h is the number of elements in the heap h. Linear complexity.

Conversions

val to_list : t -> elt list

to_list h returns the elements of the heap h, in no particular order.

val to_list_sorted : t -> elt list

to_list_sorted h returns the elements of the heap h in increasing order.

  • since 1.1
val add_list : t -> elt list -> t

add_list h l adds the elements of the list l into the heap h. An element occurring several times will be added that many times to the heap.

  • since 0.16
val of_list : elt list -> t

of_list l is add_list empty l. Complexity: O(n log n).

val add_iter : t -> elt iter -> t

add_iter h iter is like add_list.

  • since 2.8
val add_seq : t -> elt Stdlib.Seq.t -> t

add_seq h seq is like add_list. Renamed from add_std_seq since 3.0.

  • since 3.0
val of_iter : elt iter -> t

of_iter iter builds a heap from a given iter. Complexity: O(n log n).

  • since 2.8
val of_seq : elt Stdlib.Seq.t -> t

of_seq seq builds a heap from a given Seq.t. Complexity: O(n log n). Renamed from of_seq since 3.0.

  • since 3.0
val to_iter : t -> elt iter

to_iter h returns a iter of the elements of the heap h.

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

to_seq h returns a Seq.t of the elements of the heap h. Renamed from to_std_seq since 3.0.

  • since 3.0
val to_iter_sorted : t -> elt iter

to_iter_sorted h returns a iter by iterating on the elements of h, in increasing order.

  • since 2.8
val to_seq_sorted : t -> elt Stdlib.Seq.t

to_seq_sorted h returns a Seq.t by iterating on the elements of h, in increasing order. Renamed from to_std_seq_sorted since 3.0.

  • since 3.0
val add_gen : t -> elt gen -> t

add_gen h gen adds the gen gen to the heap h.

  • since 0.16
val of_gen : elt gen -> t

of_gen gen builds a heap from a given gen. Complexity: O(n log n).

val to_gen : t -> elt gen

to_gen h returns a gen of the elements of the heap h.

val to_tree : t -> elt ktree

to_tree h returns a ktree of the elements of the heap h.

val to_string : ?sep:string -> (elt -> string) -> t -> string

to_string ?sep f h prints the heap h in a string using sep as a given separator (default ",") between each element (converted to a string using f).

  • since 2.7
val pp : + ?pp_start:unit printer -> + ?pp_stop:unit printer -> + ?pp_sep:unit printer -> + elt printer -> + t printer

pp ?pp_start ?pp_stop ?pp_sep ppf h prints h on ppf. Each element is formatted with ppf, 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 ",@ "). Renamed from print since 2.0

  • since 0.16
\ No newline at end of file diff --git a/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html b/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html new file mode 100644 index 00000000..4f6ca1cf --- /dev/null +++ b/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html @@ -0,0 +1,2 @@ + +PARTIAL_ORD (containers.CCHeap.PARTIAL_ORD)

Module type CCHeap.PARTIAL_ORD

type t
val leq : t -> t -> bool

leq x y shall return true iff x is lower or equal to y.

\ No newline at end of file diff --git a/dev/containers/CCHeap/module-type-S/index.html b/dev/containers/CCHeap/module-type-S/index.html new file mode 100644 index 00000000..2950ad57 --- /dev/null +++ b/dev/containers/CCHeap/module-type-S/index.html @@ -0,0 +1,7 @@ + +S (containers.CCHeap.S)

Module type CCHeap.S

type elt
type t
val empty : t

empty returns the empty heap.

val is_empty : t -> bool

is_empty h returns true if the heap h is empty.

exception Empty
val merge : t -> t -> t

merge h1 h2 merges the two heaps h1 and h2.

val insert : elt -> t -> t

insert x h inserts an element x into the heap h.

val add : t -> elt -> t

add h x inserts an element x into the heap h.

val filter : (elt -> bool) -> t -> t

filter p h filters values, only retaining the ones that satisfy the predicate p. Linear time at least.

val find_min : t -> elt option

find_min h find the minimal element of the heap h.

val find_min_exn : t -> elt

find_min_exn h is like find_min but can fail.

  • raises Empty

    if the heap is empty.

val take : t -> (t * elt) option

take h extracts and returns the minimum element, and the new heap (without this element), or None if the heap h is empty.

val take_exn : t -> t * elt

take_exn h is like take, but can fail.

  • raises Empty

    if the heap is empty.

val delete_one : (elt -> elt -> bool) -> elt -> t -> t

delete_one eq x h uses eq to find one occurrence of a value x if it exist in the heap h, and delete it. If h do not contain x then it return h.

  • since 2.0
val delete_all : (elt -> elt -> bool) -> elt -> t -> t

delete_all eq x h uses eq to find all x in h and delete them. If h do not contain x then it return h. The difference with filter is that delete_all stops as soon as it enters a subtree whose root is bigger than the element.

  • since 2.0
val iter : (elt -> unit) -> t -> unit

iter f h iterates over the heap h invoking f with the current element.

val fold : ('a -> elt -> 'a) -> 'a -> t -> 'a

fold f acc h folds on all values of h.

val size : t -> int

size h is the number of elements in the heap h. Linear complexity.

Conversions

val to_list : t -> elt list

to_list h returns the elements of the heap h, in no particular order.

val to_list_sorted : t -> elt list

to_list_sorted h returns the elements of the heap h in increasing order.

  • since 1.1
val add_list : t -> elt list -> t

add_list h l adds the elements of the list l into the heap h. An element occurring several times will be added that many times to the heap.

  • since 0.16
val of_list : elt list -> t

of_list l is add_list empty l. Complexity: O(n log n).

val add_iter : t -> elt iter -> t

add_iter h iter is like add_list.

  • since 2.8
val add_seq : t -> elt Stdlib.Seq.t -> t

add_seq h seq is like add_list. Renamed from add_std_seq since 3.0.

  • since 3.0
val of_iter : elt iter -> t

of_iter iter builds a heap from a given iter. Complexity: O(n log n).

  • since 2.8
val of_seq : elt Stdlib.Seq.t -> t

of_seq seq builds a heap from a given Seq.t. Complexity: O(n log n). Renamed from of_seq since 3.0.

  • since 3.0
val to_iter : t -> elt iter

to_iter h returns a iter of the elements of the heap h.

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

to_seq h returns a Seq.t of the elements of the heap h. Renamed from to_std_seq since 3.0.

  • since 3.0
val to_iter_sorted : t -> elt iter

to_iter_sorted h returns a iter by iterating on the elements of h, in increasing order.

  • since 2.8
val to_seq_sorted : t -> elt Stdlib.Seq.t

to_seq_sorted h returns a Seq.t by iterating on the elements of h, in increasing order. Renamed from to_std_seq_sorted since 3.0.

  • since 3.0
val add_gen : t -> elt gen -> t

add_gen h gen adds the gen gen to the heap h.

  • since 0.16
val of_gen : elt gen -> t

of_gen gen builds a heap from a given gen. Complexity: O(n log n).

val to_gen : t -> elt gen

to_gen h returns a gen of the elements of the heap h.

val to_tree : t -> elt ktree

to_tree h returns a ktree of the elements of the heap h.

val to_string : ?sep:string -> (elt -> string) -> t -> string

to_string ?sep f h prints the heap h in a string using sep as a given separator (default ",") between each element (converted to a string using f).

  • since 2.7
val pp : + ?pp_start:unit printer -> + ?pp_stop:unit printer -> + ?pp_sep:unit printer -> + elt printer -> + t printer

pp ?pp_start ?pp_stop ?pp_sep ppf h prints h on ppf. Each element is formatted with ppf, 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 ",@ "). Renamed from print since 2.0

  • since 0.16
\ No newline at end of file diff --git a/dev/containers/CCHeap/module-type-TOTAL_ORD/index.html b/dev/containers/CCHeap/module-type-TOTAL_ORD/index.html new file mode 100644 index 00000000..9d036841 --- /dev/null +++ b/dev/containers/CCHeap/module-type-TOTAL_ORD/index.html @@ -0,0 +1,2 @@ + +TOTAL_ORD (containers.CCHeap.TOTAL_ORD)

Module type CCHeap.TOTAL_ORD

type t
val compare : t -> t -> int

compare a b shall return a negative value if a is smaller than b, 0 if a and b are equal or a positive value if a is greater than b

\ No newline at end of file diff --git a/dev/containers/CCInt/Infix/index.html b/dev/containers/CCInt/Infix/index.html new file mode 100644 index 00000000..a5349d58 --- /dev/null +++ b/dev/containers/CCInt/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCInt.Infix)

Module CCInt.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/Assoc/index.html b/dev/containers/CCList/Assoc/index.html new file mode 100644 index 00000000..a317dbaf --- /dev/null +++ b/dev/containers/CCList/Assoc/index.html @@ -0,0 +1,7 @@ + +Assoc (containers.CCList.Assoc)

Module CCList.Assoc

type ('a, 'b) t = ('a * 'b) list
val get : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'b option

get ~eq k alist returns Some v if the given key k is present into alist, or None if not present.

val get_exn : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'b

get_exn ~eq k alist returns v if the element k is present into alist. Like get, but unsafe.

  • raises Not_found

    if the element is not present.

val set : eq:('a -> 'a -> bool) -> 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t

set ~eq k v alist adds the binding k, v into the list alist (erase it if already present).

val mem : ?eq:('a -> 'a -> bool) -> 'a -> ('a, _) t -> bool

mem ?eq k alist returns true iff k is a key in alist.

  • since 0.16
val update : + eq:('a -> 'a -> bool) -> + f:('b option -> 'b option) -> + 'a -> + ('a, 'b) t -> + ('a, 'b) t

update ~eq ~f k alist updates alist on the key k, by calling f (get k alist) and removing k if it returns None, mapping k to v' if it returns Some v'.

  • since 0.16
val remove : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> ('a, 'b) t

remove ~eq k alist returns the alist without the first pair with key k, if any.

  • since 0.17
val keys : ('a, 'b) t -> 'a list

keys alist returns a list of all keys of alist.

  • since 3.8
val values : ('a, 'b) t -> 'b list

values alist returns a list of all values of alist.

  • since 3.8
val map_values : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) t

map_values f alist applies function f to all values of alist.

  • since 3.8
\ No newline at end of file diff --git a/dev/containers/CCList/Infix/index.html b/dev/containers/CCList/Infix/index.html new file mode 100644 index 00000000..91b1f74e --- /dev/null +++ b/dev/containers/CCList/Infix/index.html @@ -0,0 +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
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 diff --git a/dev/containers/CCList/Ref/index.html b/dev/containers/CCList/Ref/index.html new file mode 100644 index 00000000..f2f43544 --- /dev/null +++ b/dev/containers/CCList/Ref/index.html @@ -0,0 +1,2 @@ + +Ref (containers.CCList.Ref)

Module CCList.Ref

type 'a t = 'a list Stdlib.ref
val push : 'a t -> 'a -> unit

push rlist e adds an element e at the head of rlist.

val pop : 'a t -> 'a option

pop rlist removes and returns Some e (the first element of rlist) or None if the rlist is empty

val pop_exn : 'a t -> 'a

pop_exn rlist removes and returns the first element of rlist. Unsafe version of pop.

  • raises Failure

    if the list is empty.

val create : unit -> 'a t

create () creates a new empty reference list.

val clear : _ t -> unit

clear rlist removes all elements of rlist.

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

lift f rlist applies a list function f to the content of rlist.

val push_list : 'a t -> 'a list -> unit

push_list rlist l adds elements of the list l at the beginning of the list ref rlist. Elements at the end of the list l will be at the beginning of the list ref rlist.

\ No newline at end of file diff --git a/dev/containers/CCList/Traverse/argument-1-M/index.html b/dev/containers/CCList/Traverse/argument-1-M/index.html new file mode 100644 index 00000000..73b6e352 --- /dev/null +++ b/dev/containers/CCList/Traverse/argument-1-M/index.html @@ -0,0 +1,2 @@ + +M (containers.CCList.Traverse.M)

Parameter Traverse.M

type 'a t
val return : 'a -> 'a t

return is the Monadic return.

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

(>>=) is the Monadic bind.

\ No newline at end of file diff --git a/dev/containers/CCList/Traverse/index.html b/dev/containers/CCList/Traverse/index.html new file mode 100644 index 00000000..baacfb76 --- /dev/null +++ b/dev/containers/CCList/Traverse/index.html @@ -0,0 +1,2 @@ + +Traverse (containers.CCList.Traverse)

Module CCList.Traverse

Monadic Traverse

This allows the traversal of a 'a t list where _ t is also a monad.

For example, a 'a option list will be traversed by extracting a value from each option, returning Some [x1;…;x_n]; but if one of the option is None then the whole result is None.

Another example is with result: ('a, 'err) result list can be transformed into ('a list, 'err) result by returning the first error, or Ok [x1; …; xn] if all the elements were successful.

This describes the behavior of sequence_m; map_m is a combination of map and sequence_m; map_m_par is like map_m but useful for some pseudo monads like Lwt.

Parameters

module M : MONAD

Signature

val sequence_m : 'a M.t t -> 'a t M.t

Traverse the list of monadic values using M.(>>=), re-combining elements with (::). See the documentation of the Traverse functor itself.

val fold_m : ('b -> 'a -> 'b M.t) -> 'b -> 'a t -> 'b M.t

Fold a function with a monadic effect through a list.

val map_m : ('a -> 'b M.t) -> 'a t -> 'b t M.t

Combination of map and sequence_m.

val map_m_par : ('a -> 'b M.t) -> 'a t -> 'b t M.t

map_m_par f (x :: l) is like map_m but f x and f l are evaluated "in parallel" before combining their result (for instance in Lwt).

Basically, when encoutering x :: tl, this computes f x and map_m_par f tl, and only then is M.(>>=) used to combine the two results into a new list.

\ No newline at end of file diff --git a/dev/containers/CCList/module-type-MONAD/index.html b/dev/containers/CCList/module-type-MONAD/index.html new file mode 100644 index 00000000..6483ab60 --- /dev/null +++ b/dev/containers/CCList/module-type-MONAD/index.html @@ -0,0 +1,2 @@ + +MONAD (containers.CCList.MONAD)

Module type CCList.MONAD

Monadic Operations

type 'a t
val return : 'a -> 'a t

return is the Monadic return.

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

(>>=) is the Monadic bind.

\ No newline at end of file diff --git a/dev/containers/CCListLabels/Assoc/index.html b/dev/containers/CCListLabels/Assoc/index.html new file mode 100644 index 00000000..a06e0c6a --- /dev/null +++ b/dev/containers/CCListLabels/Assoc/index.html @@ -0,0 +1,7 @@ + +Assoc (containers.CCListLabels.Assoc)

Module CCListLabels.Assoc

type ('a, 'b) t = ('a * 'b) list
val get : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'b option

get ~eq k alist returns Some v if the given key k is present into alist, or None if not present.

val get_exn : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'b

get_exn ~eq k alist returns v if the element k is present into alist. Like get, but unsafe.

  • raises Not_found

    if the element is not present.

val set : eq:('a -> 'a -> bool) -> 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t

set ~eq k v alist adds the binding k, v into the list alist (erase it if already present).

val mem : ?eq:('a -> 'a -> bool) -> 'a -> ('a, _) t -> bool

mem ?eq k alist returns true iff k is a key in alist.

  • since 0.16
val update : + eq:('a -> 'a -> bool) -> + f:('b option -> 'b option) -> + 'a -> + ('a, 'b) t -> + ('a, 'b) t

update ~eq ~f k alist updates alist on the key k, by calling f (get alist k) and removing k if it returns None, mapping k to v' if it returns Some v'.

  • since 0.16
val remove : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> ('a, 'b) t

remove ~eq k alist returns the alist without the first pair with key k, if any.

  • since 0.17
val keys : ('a, 'b) t -> 'a list

keys alist returns a list of all keys of alist.

  • since 3.8
val values : ('a, 'b) t -> 'b list

values alist returns a list of all values of alist.

  • since 3.8
val map_values : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) t

map_values f alist applies function f to all values of alist.

  • since 3.8
\ No newline at end of file diff --git a/dev/containers/CCListLabels/Infix/index.html b/dev/containers/CCListLabels/Infix/index.html new file mode 100644 index 00000000..3b0d538d --- /dev/null +++ b/dev/containers/CCListLabels/Infix/index.html @@ -0,0 +1,9 @@ + +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 diff --git a/dev/containers/CCListLabels/Ref/index.html b/dev/containers/CCListLabels/Ref/index.html new file mode 100644 index 00000000..34717793 --- /dev/null +++ b/dev/containers/CCListLabels/Ref/index.html @@ -0,0 +1,2 @@ + +Ref (containers.CCListLabels.Ref)

Module CCListLabels.Ref

type 'a t = 'a list Stdlib.ref
val push : 'a t -> 'a -> unit

push rlist e adds an element e at the head of rlist.

val pop : 'a t -> 'a option

pop rlist removes and returns Some e (the first element of rlist) or None if the rlist is empty

val pop_exn : 'a t -> 'a

pop_exn rlist removes and returns the first element of rlist. Unsafe version of pop.

  • raises Failure

    if the list is empty.

val create : unit -> 'a t

create () creates a new empty reference list.

val clear : _ t -> unit

clear rlist removes all elements of rlist.

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

lift f rlist applies a list function f to the content of rlist.

val push_list : 'a t -> 'a list -> unit

push_list rlist l adds elements of the list l at the beginning of the list ref rlist. Elements at the end of the list l will be at the beginning of the list ref rlist.

\ No newline at end of file diff --git a/dev/containers/CCListLabels/Traverse/argument-1-M/index.html b/dev/containers/CCListLabels/Traverse/argument-1-M/index.html new file mode 100644 index 00000000..798385b5 --- /dev/null +++ b/dev/containers/CCListLabels/Traverse/argument-1-M/index.html @@ -0,0 +1,2 @@ + +M (containers.CCListLabels.Traverse.M)

Parameter Traverse.M

type 'a t
val return : 'a -> 'a t

return is the Monadic return.

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

(>>=) is the Monadic bind.

\ No newline at end of file diff --git a/dev/containers/CCListLabels/Traverse/index.html b/dev/containers/CCListLabels/Traverse/index.html new file mode 100644 index 00000000..df71bba6 --- /dev/null +++ b/dev/containers/CCListLabels/Traverse/index.html @@ -0,0 +1,2 @@ + +Traverse (containers.CCListLabels.Traverse)

Module CCListLabels.Traverse

Parameters

module M : MONAD

Signature

val sequence_m : 'a M.t t -> 'a t M.t
val fold_m : f:('b -> 'a -> 'b M.t) -> init:'b -> 'a t -> 'b M.t
val map_m : f:('a -> 'b M.t) -> 'a t -> 'b t M.t
val map_m_par : f:('a -> 'b M.t) -> 'a t -> 'b t M.t

map_m_par ~f (x :: l) is like map_m but f x and f l are evaluated "in parallel" before combining their result (for instance in Lwt).

\ No newline at end of file diff --git a/dev/containers/CCListLabels/index.html b/dev/containers/CCListLabels/index.html index c1fb01f5..278c8f78 100644 --- a/dev/containers/CCListLabels/index.html +++ b/dev/containers/CCListLabels/index.html @@ -113,7 +113,7 @@ 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.

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.

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 =
+  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 open CCList.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
diff --git a/dev/containers/CCListLabels/module-type-MONAD/index.html b/dev/containers/CCListLabels/module-type-MONAD/index.html
new file mode 100644
index 00000000..ecc08a9b
--- /dev/null
+++ b/dev/containers/CCListLabels/module-type-MONAD/index.html
@@ -0,0 +1,2 @@
+
+MONAD (containers.CCListLabels.MONAD)

Module type CCListLabels.MONAD

Monadic Operations

type 'a t
val return : 'a -> 'a t

return is the Monadic return.

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

(>>=) is the Monadic bind.

\ No newline at end of file diff --git a/dev/containers/CCOpt/Infix/index.html b/dev/containers/CCOpt/Infix/index.html new file mode 100644 index 00000000..19c6bd8d --- /dev/null +++ b/dev/containers/CCOpt/Infix/index.html @@ -0,0 +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 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 2813b5cf..bbf0fd02 100644 --- a/dev/containers/CCOpt/index.html +++ b/dev/containers/CCOpt/index.html @@ -1,2 +1,2 @@ -CCOpt (containers.CCOpt)

Module CCOpt

Previous Option module

  • deprecated

    use `CCOption` instead.

include module type of CCOption
type +'a t = 'a option
val map : ('a -> 'b) -> 'a t -> 'b t

map f o applies the function f to the element inside o, if any.

val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'b

map_or ~default f o is f x if o = Some x, default otherwise.

  • since 0.16
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'b

map_lazy default_fn f o is f x if o = Some x, default_fn () otherwise.

  • since 1.2
val is_some : _ t -> bool

is_some (Some x) returns true otherwise it returns false.

val is_none : _ t -> bool

is_none None returns true otherwise it returns false.

  • since 0.11
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.

val return : 'a -> 'a t

return x is a monadic return, that is return x = Some x.

val some : 'a -> 'a t

Alias to return.

  • since 3.5
val none : 'a t

Alias to None.

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

flat_map f o is equivalent to map followed by flatten. Flip version of >>=.

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

bind o f is f v if o is Some v, None otherwise. Monadic bind.

  • since 3.0
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.

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

iter f o applies f to o. Iterate on 0 or 1 element.

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

fold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.

val filter : ('a -> bool) -> 'a t -> 'a t

filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.

  • since 0.5
val if_ : ('a -> bool) -> 'a -> 'a option

if_ f x is Some x if f x, None otherwise.

  • since 0.17
val exists : ('a -> bool) -> 'a t -> bool

exists f o returns true iff there exists an element for which the provided function f evaluates to true.

  • since 0.17
val for_all : ('a -> bool) -> 'a t -> bool

for_all f o returns true iff the provided function f evaluates to true for all elements.

  • since 0.17
val get_or : default:'a -> 'a t -> 'a

get_or ~default o extracts the value from o, or returns default if o is None.

  • since 0.18
val value : 'a t -> default:'a -> 'a

value o ~default is similar to the Stdlib's Option.value and to get_or.

  • since 2.8
val get_exn : 'a t -> 'a

get_exn o returns x if o is Some x or fails if o is None.

  • raises Invalid_argument

    if the option is None.

val get_exn_or : string -> 'a t -> 'a

get_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.

  • raises Invalid_argument

    if the option is None.

  • since 3.4
val get_lazy : (unit -> 'a) -> 'a t -> 'a

get_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.

  • since 0.6.1
val sequence_l : 'a t list -> 'a list t

sequence_l [x1; x2; …; xn] returns Some [y1; y2; …; yn] if every xi is Some yi. Otherwise, if the list contains at least one None, the result is None.

val wrap : ?handler:(exn -> bool) -> ('a -> 'b) -> 'a -> 'b option

wrap ?handler f x calls f x and returns Some y if f x = y. If f x raises any exception, the result is None. This can be useful to wrap functions such as Map.S.find.

  • parameter handler

    the exception handler, which returns true if the exception is to be caught.

val wrap2 : ?handler:(exn -> bool) -> ('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 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 +CCOpt (containers.CCOpt)

Module CCOpt

Previous Option module

  • deprecated

    use `CCOption` instead.

include module type of CCOption
type +'a t = 'a option
val map : ('a -> 'b) -> 'a t -> 'b t

map f o applies the function f to the element inside o, if any.

val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'b

map_or ~default f o is f x if o = Some x, default otherwise.

  • since 0.16
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'b

map_lazy default_fn f o is f x if o = Some x, default_fn () otherwise.

  • since 1.2
val is_some : _ t -> bool

is_some (Some x) returns true otherwise it returns false.

val is_none : _ t -> bool

is_none None returns true otherwise it returns false.

  • since 0.11
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.

val return : 'a -> 'a t

return x is a monadic return, that is return x = Some x.

val some : 'a -> 'a t

Alias to return.

  • since 3.5
val none : 'a t

Alias to None.

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

flat_map f o is equivalent to map followed by flatten. Flip version of (>>=).

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

bind o f is f v if o is Some v, None otherwise. Monadic bind.

  • since 3.0
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.

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

iter f o applies f to o. Iterate on 0 or 1 element.

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

fold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.

val filter : ('a -> bool) -> 'a t -> 'a t

filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.

  • since 0.5
val if_ : ('a -> bool) -> 'a -> 'a option

if_ f x is Some x if f x, None otherwise.

  • since 0.17
val exists : ('a -> bool) -> 'a t -> bool

exists f o returns true iff there exists an element for which the provided function f evaluates to true.

  • since 0.17
val for_all : ('a -> bool) -> 'a t -> bool

for_all f o returns true iff the provided function f evaluates to true for all elements.

  • since 0.17
val get_or : default:'a -> 'a t -> 'a

get_or ~default o extracts the value from o, or returns default if o is None.

  • since 0.18
val value : 'a t -> default:'a -> 'a

value o ~default is similar to the Stdlib's Option.value and to get_or.

  • since 2.8
val get_exn : 'a t -> 'a

get_exn o returns x if o is Some x or fails if o is None.

  • raises Invalid_argument

    if the option is None.

val get_exn_or : string -> 'a t -> 'a

get_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.

  • raises Invalid_argument

    if the option is None.

  • since 3.4
val get_lazy : (unit -> 'a) -> 'a t -> 'a

get_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.

  • since 0.6.1
val sequence_l : 'a t list -> 'a list t

sequence_l [x1; x2; …; xn] returns Some [y1; y2; …; yn] if every xi is Some yi. Otherwise, if the list contains at least one None, the result is None.

val wrap : ?handler:(exn -> bool) -> ('a -> 'b) -> 'a -> 'b option

wrap ?handler f x calls f x and returns Some y if f x = y. If f x raises any exception, the result is None. This can be useful to wrap functions such as Map.S.find.

  • parameter handler

    the exception handler, which returns true if the exception is to be caught.

val wrap2 : ?handler:(exn -> bool) -> ('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 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 new file mode 100644 index 00000000..bedec7f7 --- /dev/null +++ b/dev/containers/CCOption/Infix/index.html @@ -0,0 +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 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 5a16e618..1e5100d4 100644 --- a/dev/containers/CCOption/index.html +++ b/dev/containers/CCOption/index.html @@ -1,2 +1,2 @@ -CCOption (containers.CCOption)

Module CCOption

Basic operations on the option type.

This module replaces `CCOpt`.

  • since 3.6
type +'a t = 'a option
val map : ('a -> 'b) -> 'a t -> 'b t

map f o applies the function f to the element inside o, if any.

val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'b

map_or ~default f o is f x if o = Some x, default otherwise.

  • since 0.16
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'b

map_lazy default_fn f o is f x if o = Some x, default_fn () otherwise.

  • since 1.2
val is_some : _ t -> bool

is_some (Some x) returns true otherwise it returns false.

val is_none : _ t -> bool

is_none None returns true otherwise it returns false.

  • since 0.11
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.

val return : 'a -> 'a t

return x is a monadic return, that is return x = Some x.

val some : 'a -> 'a t

Alias to return.

  • since 3.5
val none : 'a t

Alias to None.

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

flat_map f o is equivalent to map followed by flatten. Flip version of >>=.

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

bind o f is f v if o is Some v, None otherwise. Monadic bind.

  • since 3.0
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.

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

iter f o applies f to o. Iterate on 0 or 1 element.

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

fold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.

val filter : ('a -> bool) -> 'a t -> 'a t

filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.

  • since 0.5
val if_ : ('a -> bool) -> 'a -> 'a option

if_ f x is Some x if f x, None otherwise.

  • since 0.17
val exists : ('a -> bool) -> 'a t -> bool

exists f o returns true iff there exists an element for which the provided function f evaluates to true.

  • since 0.17
val for_all : ('a -> bool) -> 'a t -> bool

for_all f o returns true iff the provided function f evaluates to true for all elements.

  • since 0.17
val get_or : default:'a -> 'a t -> 'a

get_or ~default o extracts the value from o, or returns default if o is None.

  • since 0.18
val value : 'a t -> default:'a -> 'a

value o ~default is similar to the Stdlib's Option.value and to get_or.

  • since 2.8
val get_exn : 'a t -> 'a

get_exn o returns x if o is Some x or fails if o is None.

  • raises Invalid_argument

    if the option is None.

val get_exn_or : string -> 'a t -> 'a

get_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.

  • raises Invalid_argument

    if the option is None.

  • since 3.4
val get_lazy : (unit -> 'a) -> 'a t -> 'a

get_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.

  • since 0.6.1
val sequence_l : 'a t list -> 'a list t

sequence_l [x1; x2; …; xn] returns Some [y1; y2; …; yn] if every xi is Some yi. Otherwise, if the list contains at least one None, the result is None.

val wrap : ?handler:(exn -> bool) -> ('a -> 'b) -> 'a -> 'b option

wrap ?handler f x calls f x and returns Some y if f x = y. If f x raises any exception, the result is None. This can be useful to wrap functions such as Map.S.find.

  • parameter handler

    the exception handler, which returns true if the exception is to be caught.

val wrap2 : ?handler:(exn -> bool) -> ('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 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 +CCOption (containers.CCOption)

Module CCOption

Basic operations on the option type.

This module replaces `CCOpt`.

  • since 3.6
type +'a t = 'a option
val map : ('a -> 'b) -> 'a t -> 'b t

map f o applies the function f to the element inside o, if any.

val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'b

map_or ~default f o is f x if o = Some x, default otherwise.

  • since 0.16
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'b

map_lazy default_fn f o is f x if o = Some x, default_fn () otherwise.

  • since 1.2
val is_some : _ t -> bool

is_some (Some x) returns true otherwise it returns false.

val is_none : _ t -> bool

is_none None returns true otherwise it returns false.

  • since 0.11
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.

val return : 'a -> 'a t

return x is a monadic return, that is return x = Some x.

val some : 'a -> 'a t

Alias to return.

  • since 3.5
val none : 'a t

Alias to None.

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

flat_map f o is equivalent to map followed by flatten. Flip version of (>>=).

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

bind o f is f v if o is Some v, None otherwise. Monadic bind.

  • since 3.0
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.

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

iter f o applies f to o. Iterate on 0 or 1 element.

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

fold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.

val filter : ('a -> bool) -> 'a t -> 'a t

filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. Filter on 0 or 1 element.

  • since 0.5
val if_ : ('a -> bool) -> 'a -> 'a option

if_ f x is Some x if f x, None otherwise.

  • since 0.17
val exists : ('a -> bool) -> 'a t -> bool

exists f o returns true iff there exists an element for which the provided function f evaluates to true.

  • since 0.17
val for_all : ('a -> bool) -> 'a t -> bool

for_all f o returns true iff the provided function f evaluates to true for all elements.

  • since 0.17
val get_or : default:'a -> 'a t -> 'a

get_or ~default o extracts the value from o, or returns default if o is None.

  • since 0.18
val value : 'a t -> default:'a -> 'a

value o ~default is similar to the Stdlib's Option.value and to get_or.

  • since 2.8
val get_exn : 'a t -> 'a

get_exn o returns x if o is Some x or fails if o is None.

  • raises Invalid_argument

    if the option is None.

val get_exn_or : string -> 'a t -> 'a

get_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.

  • raises Invalid_argument

    if the option is None.

  • since 3.4
val get_lazy : (unit -> 'a) -> 'a t -> 'a

get_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.

  • since 0.6.1
val sequence_l : 'a t list -> 'a list t

sequence_l [x1; x2; …; xn] returns Some [y1; y2; …; yn] if every xi is Some yi. Otherwise, if the list contains at least one None, the result is None.

val wrap : ?handler:(exn -> bool) -> ('a -> 'b) -> 'a -> 'b option

wrap ?handler f x calls f x and returns Some y if f x = y. If f x raises any exception, the result is None. This can be useful to wrap functions such as Map.S.find.

  • parameter handler

    the exception handler, which returns true if the exception is to be caught.

val wrap2 : ?handler:(exn -> bool) -> ('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 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/CCParse/Debug_/index.html b/dev/containers/CCParse/Debug_/index.html new file mode 100644 index 00000000..76bf2c39 --- /dev/null +++ b/dev/containers/CCParse/Debug_/index.html @@ -0,0 +1,2 @@ + +Debug_ (containers.CCParse.Debug_)

Module CCParse.Debug_

Debugging utils. EXPERIMENTAL

  • since 3.6
val trace_fail : string -> 'a t -> 'a t

trace_fail name p behaves like p, but prints the error message of p on stderr whenever p fails.

  • parameter name

    used as a prefix of all trace messages.

val trace_success : string -> print:('a -> string) -> 'a t -> 'a t

trace_success name ~print p behaves like p, but prints successful runs of p using print.

val trace_success_or_fail : string -> print:('a -> string) -> 'a t -> 'a t

Trace both error or success

\ No newline at end of file diff --git a/dev/containers/CCParse/Error/index.html b/dev/containers/CCParse/Error/index.html new file mode 100644 index 00000000..26fbacf4 --- /dev/null +++ b/dev/containers/CCParse/Error/index.html @@ -0,0 +1,2 @@ + +Error (containers.CCParse.Error)

Module CCParse.Error

Errors

  • since 3.6
type t

A parse error.

  • since 3.6
val position : t -> position

Returns position of the error

val line_and_column : t -> int * int

Line and column numbers of the error position.

val msg : t -> string
val to_string : t -> string

Prints the error

val pp : Stdlib.Format.formatter -> t -> unit

Pretty prints the error

\ No newline at end of file diff --git a/dev/containers/CCParse/Infix/index.html b/dev/containers/CCParse/Infix/index.html new file mode 100644 index 00000000..44b5d7ef --- /dev/null +++ b/dev/containers/CCParse/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCParse.Infix)

Module CCParse.Infix

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

Alias to map. p >|= f parses an item x using p, and returns f x.

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

Alias to bind. p >>= f results in a new parser which behaves as p then, in case of success, applies f to the result.

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

Applicative.

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

a <* b parses a into x, parses b and ignores its result, and returns x.

val (*>) : _ t -> 'a t -> 'a t

a *> b parses a, then parses b into x, and returns x. The result of a is ignored.

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

Alias to or_.

a <|> b tries to parse a, and if a fails without consuming any input, backtracks and tries to parse b, otherwise it fails as a.

val (<?>) : 'a t -> string -> 'a t

a <?> msg behaves like a, but if a fails, a <?> msg fails with msg instead. Useful as the last choice in a series of <|>. For example: a <|> b <|> c <?> "expected one of a, b, c".

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

Alias to both. a ||| b parses a, then b, then returns the pair of their results.

  • since 3.6

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/CCParse/Position/index.html b/dev/containers/CCParse/Position/index.html new file mode 100644 index 00000000..ed5c1220 --- /dev/null +++ b/dev/containers/CCParse/Position/index.html @@ -0,0 +1,2 @@ + +Position (containers.CCParse.Position)

Module CCParse.Position

Positions in input

  • since 3.6
type t = position
val line : t -> int

Line number, 0 based

val column : t -> int

Column number, 0 based

val line_and_column : t -> int * int

Line and column number

val pp : Stdlib.Format.formatter -> t -> unit

Unspecified pretty-printed version of the position.

\ No newline at end of file diff --git a/dev/containers/CCParse/Slice/index.html b/dev/containers/CCParse/Slice/index.html new file mode 100644 index 00000000..5d8664f1 --- /dev/null +++ b/dev/containers/CCParse/Slice/index.html @@ -0,0 +1,2 @@ + +Slice (containers.CCParse.Slice)

Module CCParse.Slice

Functions on slices.

  • since 3.6
type t = slice
val is_empty : t -> bool

Is the slice empty?

val length : t -> int

Length of the slice

val to_string : t -> string

Convert the slice into a string. Linear time and memory in length slice

\ No newline at end of file diff --git a/dev/containers/CCParse/U/index.html b/dev/containers/CCParse/U/index.html new file mode 100644 index 00000000..7dffd588 --- /dev/null +++ b/dev/containers/CCParse/U/index.html @@ -0,0 +1,15 @@ + +U (containers.CCParse.U)

Module CCParse.U

Utils

This is useful to parse OCaml-like values in a simple way. All the parsers are whitespace-insensitive (they skip whitespace).

val list : ?start:string -> ?stop:string -> ?sep:string -> 'a t -> 'a list t

list p parses a list of p, with the OCaml conventions for start token "[", stop token "]" and separator ";". Whitespace between items are skipped.

val int : int t

Parse an int in decimal representation.

val in_paren : 'a t -> 'a t

in_paren p parses an opening "(",p , and then ")".

  • since 3.6
val in_parens_opt : 'a t -> 'a t

in_parens_opt p parses p in an arbitrary number of nested parenthesis (possibly 0).

  • since 3.6
val option : 'a t -> 'a option t

option p parses "Some <x>" into Some x if p parses "<x>" into x, and parses "None" into None.

  • since 3.6
val hexa_int : int t

Parse an int int hexadecimal format. Accepts an optional 0x prefix, and ignores capitalization.

  • since 3.6
val word : string t

Non empty string of alpha num, start with alpha.

val bool : bool t

Accepts "true" or "false"

  • since 3.6
val pair : + ?start:string -> + ?stop:string -> + ?sep:string -> + 'a t -> + 'b t -> + ('a * 'b) t

Parse a pair using OCaml syntactic conventions. The default is "(a, b)".

val triple : + ?start:string -> + ?stop:string -> + ?sep:string -> + 'a t -> + 'b t -> + 'c t -> + ('a * 'b * 'c) t

Parse a triple using OCaml syntactic conventions. The default is "(a, b, c)".

\ No newline at end of file diff --git a/dev/containers/CCParse/index.html b/dev/containers/CCParse/index.html index 8937ac6b..c88ef66d 100644 --- a/dev/containers/CCParse/index.html +++ b/dev/containers/CCParse/index.html @@ -24,7 +24,7 @@ let l_printed = let l' = CCParse.parse_string_exn p l_printed;; -assert (l=l');;

Stability guarantees

Some functions are marked "experimental" and are still subject to change.

type position

A position in the input. Typically it'll point at the beginning of an error location.

module Position : sig ... end
module Error : sig ... end
type +'a or_error = ('a, Error.t) Stdlib.result

'a or_error is either Ok x for some result x : 'a, or an error Error.t.

See stringify_result and Error.to_string to print the error message.

exception ParseError of Error.t

Input

Combinators

type 'a t

The abstract type of parsers that return a value of type 'a (or fail).

  • raises ParseError

    in case of failure.

  • since 3.6 the type is private.
val return : 'a -> 'a t

Always succeeds, without consuming its input.

val pure : 'a -> 'a t

Synonym to return.

val map : ('a -> 'b) -> 'a t -> 'b t
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
val map3 : ('a -> 'b -> 'c -> 'd) -> 'a t -> 'b t -> 'c t -> 'd t
val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f p results in a new parser which behaves as p then, in case of success, applies f to the result.

  • since 3.6
val ap : ('a -> 'b) t -> 'a t -> 'b t

Applicative.

  • since 3.6
val eoi : unit t

Expect the end of input, fails otherwise.

val empty : unit t

Succeed with ().

  • since 3.6
val fail : string -> 'a t

fail msg fails with the given message. It can trigger a backtrack.

val failf : ('a, unit, string, 'b t) Stdlib.format4 -> 'a

Format.sprintf version of fail.

val fail_lazy : (unit -> string) -> 'a t

Like fail, but only produce an error message on demand.

  • since 3.6
val parsing : string -> 'a t -> 'a t

parsing s p behaves the same as p, with the information that we are parsing s, if p fails. The message s is added to the error, it does not replace it, not does the location change (the error still points to the same location as in p).

val set_error_message : string -> 'a t -> 'a t

set_error_message msg p behaves like p, but if p fails, set_error_message msg p fails with msg instead and at the current position. The internal error message of p is just discarded.

  • since 3.6
val pos : position t

pos returns the current position in the buffer.

EXPERIMENTAL

  • since 3.7
val with_pos : 'a t -> ('a * position) t

with_pos p behaves like p, but returns the (starting) position along with p's result.

EXPERIMENTAL

  • since 3.6
val any_char : char t

any_char parses any character. It still fails if the end of input was reached.

  • since 3.6
val any_char_n : int -> string t

any_char_n len parses exactly len characters from the input. Fails if the input doesn't contain at least len chars.

  • since 3.6
val char : char -> char t

char c parses the character c and nothing else.

type slice

A slice of the input, as returned by some combinators such as split_1 or split_list or take.

The idea is that one can use some parsers to cut the input into slices, e.g. split into lines, or split a line into fields (think CSV or TSV). Then a variety of parsers can be used on each slice to extract data from it using recurse.

Slices contain enough information to make it possible for recurse slice p to report failures (if p fails) using locations from the original input, not relative to the slice. Therefore, even after splitting the input into lines using, say, each_line, a failure to parse the 500th line will be reported at line 500 and not at line 1.

EXPERIMENTAL

  • since 3.6
module Slice : sig ... end

Functions on slices.

val recurse : slice -> 'a t -> 'a t

recurse slice p parses the slice (most likely obtained via another combinator, such as split_1 or split_n), using p.

The slice contains a position which is used to relocate error messages to their position in the whole input, not just relative to the slice.

EXPERIMENTAL

  • since 3.6
val set_current_slice : slice -> unit t

set_current_slice slice replaces the parser's state with slice.

EXPERIMENTAL

  • since 3.6
val chars_fold : +assert (l=l');;

Stability guarantees

Some functions are marked "experimental" and are still subject to change.

type position

A position in the input. Typically it'll point at the beginning of an error location.

module Position : sig ... end
module Error : sig ... end
type +'a or_error = ('a, Error.t) Stdlib.result

'a or_error is either Ok x for some result x : 'a, or an error Error.t.

See stringify_result and Error.to_string to print the error message.

exception ParseError of Error.t

Input

Combinators

type 'a t

The abstract type of parsers that return a value of type 'a (or fail).

  • raises ParseError

    in case of failure.

  • since 3.6 the type is private.
val return : 'a -> 'a t

Always succeeds, without consuming its input.

val pure : 'a -> 'a t

Synonym to return.

val map : ('a -> 'b) -> 'a t -> 'b t
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
val map3 : ('a -> 'b -> 'c -> 'd) -> 'a t -> 'b t -> 'c t -> 'd t
val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f p results in a new parser which behaves as p then, in case of success, applies f to the result.

  • since 3.6
val ap : ('a -> 'b) t -> 'a t -> 'b t

Applicative.

  • since 3.6
val eoi : unit t

Expect the end of input, fails otherwise.

val empty : unit t

Succeed with ().

  • since 3.6
val fail : string -> 'a t

fail msg fails with the given message. It can trigger a backtrack.

val failf : ('a, unit, string, 'b t) Stdlib.format4 -> 'a

Format.sprintf version of fail.

val fail_lazy : (unit -> string) -> 'a t

Like fail, but only produce an error message on demand.

  • since 3.6
val parsing : string -> 'a t -> 'a t

parsing s p behaves the same as p, with the information that we are parsing s, if p fails. The message s is added to the error, it does not replace it, not does the location change (the error still points to the same location as in p).

val set_error_message : string -> 'a t -> 'a t

set_error_message msg p behaves like p, but if p fails, set_error_message msg p fails with msg instead and at the current position. The internal error message of p is just discarded.

  • since 3.6
val pos : position t

pos returns the current position in the buffer.

EXPERIMENTAL

  • since 3.7
val with_pos : 'a t -> ('a * position) t

with_pos p behaves like p, but returns the (starting) position along with p's result.

EXPERIMENTAL

  • since 3.6
val any_char : char t

any_char parses any character. It still fails if the end of input was reached.

  • since 3.6
val any_char_n : int -> string t

any_char_n len parses exactly len characters from the input. Fails if the input doesn't contain at least len chars.

  • since 3.6
val char : char -> char t

char c parses the character c and nothing else.

type slice

A slice of the input, as returned by some combinators such as split_1 or split_list or take.

The idea is that one can use some parsers to cut the input into slices, e.g. split into lines, or split a line into fields (think CSV or TSV). Then a variety of parsers can be used on each slice to extract data from it using recurse.

Slices contain enough information to make it possible for recurse slice p to report failures (if p fails) using locations from the original input, not relative to the slice. Therefore, even after splitting the input into lines using, say, each_line, a failure to parse the 500th line will be reported at line 500 and not at line 1.

EXPERIMENTAL

  • since 3.6
module Slice : sig ... end

Functions on slices.

val recurse : slice -> 'a t -> 'a t

recurse slice p parses the slice (most likely obtained via another combinator, such as split_1 or split_list), using p.

The slice contains a position which is used to relocate error messages to their position in the whole input, not just relative to the slice.

EXPERIMENTAL

  • since 3.6
val set_current_slice : slice -> unit t

set_current_slice slice replaces the parser's state with slice.

EXPERIMENTAL

  • since 3.6
val chars_fold : f: ('acc -> char -> @@ -43,6 +43,6 @@ assert (l=l');;

-> 'acc -> - ('acc * string) t

Same as char_fold but with the following differences:

  • returns a string along with the accumulator, rather than the slice of all the characters accepted by `Continue _. The string is built from characters returned by `Yield.
  • new case `Yield (acc, c) adds c to the returned string and continues parsing with acc.
  • since 3.6
val take : int -> slice t

take len parses exactly len characters from the input. Fails if the input doesn't contain at least len chars.

  • since 3.6
val take_if : (char -> bool) -> slice t

take_if f takes characters as long as they satisfy the predicate f.

  • since 3.6
val take1_if : ?descr:string -> (char -> bool) -> slice t

take1_if f takes characters as long as they satisfy the predicate f. Fails if no character satisfies f.

  • parameter descr

    describes what kind of character was expected, in case of error

  • since 3.6
val char_if : ?descr:string -> (char -> bool) -> char t

char_if f parses a character c if f c = true. Fails if the next char does not satisfy f.

  • parameter descr

    describes what kind of character was expected, in case of error

val chars_if : (char -> bool) -> string t

chars_if f parses a string of chars that satisfy f. Cannot fail.

val chars1_if : ?descr:string -> (char -> bool) -> string t

Like chars_if, but accepts only non-empty strings. chars1_if p fails if the string accepted by chars_if p is empty. chars1_if p is equivalent to take1_if p >|= Slice.to_string.

  • parameter descr

    describes what kind of character was expected, in case of error

val endline : char t

Parse '\n'.

val space : char t

Tab or space.

val white : char t

Tab or space or newline.

val skip_chars : (char -> bool) -> unit t

Skip 0 or more chars satisfying the predicate.

val skip_space : unit t

Skip ' ' and '\t'.

val skip_white : unit t

Skip ' ' and '\t' and '\n'.

val is_alpha : char -> bool

Is the char a letter?

val is_num : char -> bool

Is the char a digit?

val is_alpha_num : char -> bool

Is the char a letter or a digit?

val is_space : char -> bool

True on ' ' and '\t'.

val is_white : char -> bool

True on ' ' and '\t' and '\n'.

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

suspend f is the same as f (), but evaluates f () only when needed.

A practical use case is to implement recursive parsers manually, as described in fix. The parser is let rec p () = …, and suspend p can be used in the definition to use p.

val string : string -> string t

string s parses exactly the string s, and nothing else.

val exact : string -> string t

Alias to string.

  • since 3.6
val many : 'a t -> 'a list t

many p parses p repeatedly, until p fails, and collects the results into a list.

val optional : _ t -> unit t

optional p tries to parse p, and return () whether it succeeded or failed. Cannot fail itself. It consumes input if p succeeded (as much as p consumed), but consumes not input if p failed.

  • since 3.6
val try_ : 'a t -> 'a t

try_ p is just like p (it used to play a role in backtracking semantics but no more).

  • deprecated

    since 3.6 it can just be removed. See try_opt if you want to detect failure.

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

try_opt p tries to parse using p, and return Some x if p succeeded with x (and consumes what p consumed). Otherwise it returns None and consumes nothing. This cannot fail.

  • since 3.6
val many_until : until:_ t -> 'a t -> 'a list t

many_until ~until p parses as many p as it can until the until parser successfully returns. If p fails before that then many_until ~until p fails as well. Typically until can be a closing ')' or another termination condition, and what is consumed by until is also consumed by many_until ~until p.

EXPERIMENTAL

  • since 3.6
val try_or : 'a t -> f:('a -> 'b t) -> else_:'b t -> 'b t

try_or p1 ~f ~else_:p2 attempts to parse x using p1, and then becomes f x. If p1 fails, then it becomes p2. This can be useful if f is expensive but only ever works if p1 matches (e.g. after an opening parenthesis or some sort of prefix).

  • since 3.6
val try_or_l : ?msg:string -> ?else_:'a t -> (unit t * 'a t) list -> 'a t

try_or_l ?else_ l tries each pair (test, p) in order. If the n-th test succeeds, then try_or_l l behaves like n-th p, whether p fails or not. If test consumes input, the state is restored before calling p. If they all fail, and else_ is defined, then it behaves like else_. If all fail, and else_ is None, then it fails as well.

This is a performance optimization compared to (<|>). We commit to a branch if the test succeeds, without backtracking at all. It can also provide better error messages, because failures in the parser will not be reported as failures in try_or_l.

See lookahead_ignore for a convenient way of writing the test conditions.

  • parameter msg

    error message if all options fail

    EXPERIMENTAL

  • since 3.6
val or_ : 'a t -> 'a t -> 'a t

or_ p1 p2 tries to parse p1, and if it fails, tries p2 from the same position.

  • since 3.6
val both : 'a t -> 'b t -> ('a * 'b) t

both a b parses a, then b, then returns the pair of their results.

  • since 3.6
val many1 : 'a t -> 'a list t

many1 p is like many p excepts it fails if the list is empty (i.e. it needs p to succeed at least once).

val skip : _ t -> unit t

skip p parses zero or more times p and ignores its result. It is eager, meaning it will continue as long as p succeeds. As soon as p fails, skip p stops consuming any input.

val sep : by:_ t -> 'a t -> 'a list t

sep ~by p parses a list of p separated by by.

val sep_until : until:_ t -> by:_ t -> 'a t -> 'a list t

Same as sep but stop when until parses successfully.

  • since 3.6
val sep1 : by:_ t -> 'a t -> 'a list t

sep1 ~by p parses a non empty list of p, separated by by.

val lookahead : 'a t -> 'a t

lookahead p behaves like p, except it doesn't consume any input.

EXPERIMENTAL

  • since 3.6
val lookahead_ignore : 'a t -> unit t

lookahead_ignore p tries to parse input with p, and succeeds if p succeeds. However it doesn't consume any input and returns (), so in effect its only use-case is to detect whether p succeeds, e.g. in try_or_l.

EXPERIMENTAL

  • since 3.6
val fix : ('a t -> 'a t) -> 'a t

Fixpoint combinator. fix (fun self -> p) is the parser p, in which self refers to the parser p itself (which is useful to parse recursive structures.

An alternative, manual implementation to let p = fix (fun self -> q) is:

let rec p () =
+  ('acc * string) t

Same as chars_fold but with the following differences:

  • returns a string along with the accumulator, rather than the slice of all the characters accepted by `Continue _. The string is built from characters returned by `Yield.
  • new case `Yield (acc, c) adds c to the returned string and continues parsing with acc.
  • since 3.6
val take : int -> slice t

take len parses exactly len characters from the input. Fails if the input doesn't contain at least len chars.

  • since 3.6
val take_if : (char -> bool) -> slice t

take_if f takes characters as long as they satisfy the predicate f.

  • since 3.6
val take1_if : ?descr:string -> (char -> bool) -> slice t

take1_if f takes characters as long as they satisfy the predicate f. Fails if no character satisfies f.

  • parameter descr

    describes what kind of character was expected, in case of error

  • since 3.6
val char_if : ?descr:string -> (char -> bool) -> char t

char_if f parses a character c if f c = true. Fails if the next char does not satisfy f.

  • parameter descr

    describes what kind of character was expected, in case of error

val chars_if : (char -> bool) -> string t

chars_if f parses a string of chars that satisfy f. Cannot fail.

val chars1_if : ?descr:string -> (char -> bool) -> string t

Like chars_if, but accepts only non-empty strings. chars1_if p fails if the string accepted by chars_if p is empty. chars1_if p is equivalent to take1_if p >|= Slice.to_string.

  • parameter descr

    describes what kind of character was expected, in case of error

val endline : char t

Parse '\n'.

val space : char t

Tab or space.

val white : char t

Tab or space or newline.

val skip_chars : (char -> bool) -> unit t

Skip 0 or more chars satisfying the predicate.

val skip_space : unit t

Skip ' ' and '\t'.

val skip_white : unit t

Skip ' ' and '\t' and '\n'.

val is_alpha : char -> bool

Is the char a letter?

val is_num : char -> bool

Is the char a digit?

val is_alpha_num : char -> bool

Is the char a letter or a digit?

val is_space : char -> bool

True on ' ' and '\t'.

val is_white : char -> bool

True on ' ' and '\t' and '\n'.

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

suspend f is the same as f (), but evaluates f () only when needed.

A practical use case is to implement recursive parsers manually, as described in fix. The parser is let rec p () = …, and suspend p can be used in the definition to use p.

val string : string -> string t

string s parses exactly the string s, and nothing else.

val exact : string -> string t

Alias to string.

  • since 3.6
val many : 'a t -> 'a list t

many p parses p repeatedly, until p fails, and collects the results into a list.

val optional : _ t -> unit t

optional p tries to parse p, and return () whether it succeeded or failed. Cannot fail itself. It consumes input if p succeeded (as much as p consumed), but consumes not input if p failed.

  • since 3.6
val try_ : 'a t -> 'a t

try_ p is just like p (it used to play a role in backtracking semantics but no more).

  • deprecated

    since 3.6 it can just be removed. See try_opt if you want to detect failure.

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

try_opt p tries to parse using p, and return Some x if p succeeded with x (and consumes what p consumed). Otherwise it returns None and consumes nothing. This cannot fail.

  • since 3.6
val many_until : until:_ t -> 'a t -> 'a list t

many_until ~until p parses as many p as it can until the until parser successfully returns. If p fails before that then many_until ~until p fails as well. Typically until can be a closing ')' or another termination condition, and what is consumed by until is also consumed by many_until ~until p.

EXPERIMENTAL

  • since 3.6
val try_or : 'a t -> f:('a -> 'b t) -> else_:'b t -> 'b t

try_or p1 ~f ~else_:p2 attempts to parse x using p1, and then becomes f x. If p1 fails, then it becomes p2. This can be useful if f is expensive but only ever works if p1 matches (e.g. after an opening parenthesis or some sort of prefix).

  • since 3.6
val try_or_l : ?msg:string -> ?else_:'a t -> (unit t * 'a t) list -> 'a t

try_or_l ?else_ l tries each pair (test, p) in order. If the n-th test succeeds, then try_or_l l behaves like n-th p, whether p fails or not. If test consumes input, the state is restored before calling p. If they all fail, and else_ is defined, then it behaves like else_. If all fail, and else_ is None, then it fails as well.

This is a performance optimization compared to (<|>). We commit to a branch if the test succeeds, without backtracking at all. It can also provide better error messages, because failures in the parser will not be reported as failures in try_or_l.

See lookahead_ignore for a convenient way of writing the test conditions.

  • parameter msg

    error message if all options fail

    EXPERIMENTAL

  • since 3.6
val or_ : 'a t -> 'a t -> 'a t

or_ p1 p2 tries to parse p1, and if it fails, tries p2 from the same position.

  • since 3.6
val both : 'a t -> 'b t -> ('a * 'b) t

both a b parses a, then b, then returns the pair of their results.

  • since 3.6
val many1 : 'a t -> 'a list t

many1 p is like many p excepts it fails if the list is empty (i.e. it needs p to succeed at least once).

val skip : _ t -> unit t

skip p parses zero or more times p and ignores its result. It is eager, meaning it will continue as long as p succeeds. As soon as p fails, skip p stops consuming any input.

val sep : by:_ t -> 'a t -> 'a list t

sep ~by p parses a list of p separated by by.

val sep_until : until:_ t -> by:_ t -> 'a t -> 'a list t

Same as sep but stop when until parses successfully.

  • since 3.6
val sep1 : by:_ t -> 'a t -> 'a list t

sep1 ~by p parses a non empty list of p, separated by by.

val lookahead : 'a t -> 'a t

lookahead p behaves like p, except it doesn't consume any input.

EXPERIMENTAL

  • since 3.6
val lookahead_ignore : 'a t -> unit t

lookahead_ignore p tries to parse input with p, and succeeds if p succeeds. However it doesn't consume any input and returns (), so in effect its only use-case is to detect whether p succeeds, e.g. in try_or_l.

EXPERIMENTAL

  • since 3.6
val fix : ('a t -> 'a t) -> 'a t

Fixpoint combinator. fix (fun self -> p) is the parser p, in which self refers to the parser p itself (which is useful to parse recursive structures.

An alternative, manual implementation to let p = fix (fun self -> q) is:

let rec p () =
  let self = suspend p in
  q
val line : slice t

Parse a line, '\n' excluded, and position the cursor after the '\n'.

  • since 3.6
val line_str : string t

line_str is line >|= Slice.to_string. It parses the next line and turns the slice into a string. The state points to the character immediately after the '\n' character.

  • since 3.6
val each_line : 'a t -> 'a list t

each_line p runs p on each line of the input. EXPERIMENTAL

  • since 3.6
val split_1 : on_char:char -> (slice * slice option) t

split_1 ~on_char looks for on_char in the input, and returns a pair sl1, sl2, where:

  • sl1 is the slice of the input the precedes the first occurrence of on_char, or the whole input if on_char cannot be found. It does not contain on_char.
  • sl2 is the slice that comes after on_char, or None if on_char couldn't be found. It doesn't contain the first occurrence of on_char (if any).

The parser is now positioned at the end of the input.

EXPERIMENTAL

  • since 3.6
val split_list : on_char:char -> slice list t

split_list ~on_char splits the input on all occurrences of on_char, returning a list of slices.

EXPERIMENTAL

  • since 3.6
val split_list_at_most : on_char:char -> int -> slice list t

split_list_at_most ~on_char n applies split_1 ~on_char at most n times, to get a list of n+1 elements. The last element might contain on_char. This is useful to limit the amount of work done by split_list.

EXPERIMENTAL

  • since 3.6
val split_2 : on_char:char -> (slice * slice) t

split_2 ~on_char splits the input into exactly 2 fields, and fails if the split yields less or more than 2 items. EXPERIMENTAL

  • since 3.6
val split_3 : on_char:char -> (slice * slice * slice) t

See split_2 EXPERIMENTAL

  • since 3.6
val split_4 : on_char:char -> (slice * slice * slice * slice) t

See split_2 EXPERIMENTAL

  • since 3.6
val each_split : on_char:char -> 'a t -> 'a list t

split_list_map ~on_char p uses split_list ~on_char to split the input, then parses each chunk of the input thus obtained using p.

The difference with sep ~by:(char on_char) p is that sep calls p first, and only tries to find on_char after p returns. While it is more flexible, this technique also means p has to be careful not to consume on_char by error.

A useful specialization of this is each_line, which is basically each_split ~on_char:'\n' p.

EXPERIMENTAL

  • since 3.6
val all : slice t

all returns all the unconsumed input as a slice, and consumes it. Use Slice.to_string to turn it into a string.

Note that lookahead all can be used to peek at the rest of the input without consuming anything.

  • since 3.6
val all_str : string t

all_str accepts all the remaining chars and extracts them into a string. Similar to all but with a string.

EXPERIMENTAL

  • since 3.6
val memo : 'a t -> 'a t

Memoize the parser. memo p will behave like p, but when called in a state (read: position in input) it has already processed, memo p returns a result directly. The implementation uses an underlying hashtable. This can be costly in memory, but improve the run time a lot if there is a lot of backtracking involving p.

Do not call memo inside other functions, especially with (>>=), map, etc. being so prevalent. Instead the correct way to use it is in a toplevel definition:

let my_expensive_parser = memo (foo *> bar >>= fun i -> …)

This function is not thread-safe.

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

Like fix, but the fixpoint is memoized.

Infix

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

Alias to map. p >|= f parses an item x using p, and returns f x.

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

Alias to bind. p >>= f results in a new parser which behaves as p then, in case of success, applies f to the result.

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

Applicative.

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

a <* b parses a into x, parses b and ignores its result, and returns x.

val (*>) : _ t -> 'a t -> 'a t

a *> b parses a, then parses b into x, and returns x. The result of a is ignored.

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

Alias to or_.

a <|> b tries to parse a, and if a fails without consuming any input, backtracks and tries to parse b, otherwise it fails as a.

val (<?>) : 'a t -> string -> 'a t

a <?> msg behaves like a, but if a fails, a <?> msg fails with msg instead. Useful as the last choice in a series of <|>. For example: a <|> b <|> c <?> "expected one of a, b, c".

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

Alias to both. a ||| b parses a, then b, then returns the pair of their results.

  • since 3.6

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

Parse input

val stringify_result : 'a or_error -> ('a, string) Stdlib.result

Turn a Error.t-oriented result into a more basic string result.

  • since 3.6
val parse_string : 'a t -> string -> ('a, string) Stdlib.result

Parse a string using the parser.

val parse_string_e : 'a t -> string -> 'a or_error

Version of parse_string that returns a more detailed error.

val parse_string_exn : 'a t -> string -> 'a
  • raises ParseError

    if it fails.

val parse_file : 'a t -> string -> ('a, string) Stdlib.result

parse_file p filename parses file named filename with p by opening the file and reading it whole.

val parse_file_e : 'a t -> string -> 'a or_error

Version of parse_file that returns a more detailed error.

val parse_file_exn : 'a t -> string -> 'a

Same as parse_file, but

  • raises ParseError

    if it fails.

module U : sig ... end
module Debug_ : sig ... end

Debugging utils. EXPERIMENTAL

\ No newline at end of file diff --git a/dev/containers/CCSeq/Infix/index.html b/dev/containers/CCSeq/Infix/index.html new file mode 100644 index 00000000..eef4f7c4 --- /dev/null +++ b/dev/containers/CCSeq/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCSeq.Infix)

Module CCSeq.Infix

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
val (>>-) : 'a t -> ('a -> 'b t) -> 'b t
val (<.>) : ('a -> 'b) t -> 'a t -> 'b t
val (--) : int -> int -> int t
val (--^) : int -> int -> int t
\ No newline at end of file diff --git a/dev/containers/CCSeq/Traverse/argument-1-M/index.html b/dev/containers/CCSeq/Traverse/argument-1-M/index.html new file mode 100644 index 00000000..ef0cfec6 --- /dev/null +++ b/dev/containers/CCSeq/Traverse/argument-1-M/index.html @@ -0,0 +1,2 @@ + +M (containers.CCSeq.Traverse.M)

Parameter Traverse.M

type 'a t
val return : 'a -> 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
\ No newline at end of file diff --git a/dev/containers/CCSeq/Traverse/index.html b/dev/containers/CCSeq/Traverse/index.html new file mode 100644 index 00000000..72354edd --- /dev/null +++ b/dev/containers/CCSeq/Traverse/index.html @@ -0,0 +1,2 @@ + +Traverse (containers.CCSeq.Traverse)

Module CCSeq.Traverse

Parameters

module M : MONAD

Signature

val sequence_m : 'a M.t t -> 'a t M.t
val fold_m : ('b -> 'a -> 'b M.t) -> 'b -> 'a t -> 'b M.t
val map_m : ('a -> 'b M.t) -> 'a t -> 'b t M.t
\ No newline at end of file diff --git a/dev/containers/CCSeq/index.html b/dev/containers/CCSeq/index.html index e5d6778e..89f36de6 100644 --- a/dev/containers/CCSeq/index.html +++ b/dev/containers/CCSeq/index.html @@ -1,5 +1,5 @@ -CCSeq (containers.CCSeq)

Module CCSeq

Helpers for the standard Seq type

See oseq for a richer API.

  • since 3.0
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

include module type of Stdlib.Seq
type !'a t = unit -> 'a node
and !'a node = 'a Stdlib__Seq.node =
  1. | Nil
  2. | Cons of 'a * 'a t
exception Forced_twice
val once : 'a t -> 'a t
val transpose : 'a t t -> 'a t t
val partition_map : ('a -> ('b, 'c) Stdlib.Either.t) -> 'a t -> 'b t * 'c t
val partition : ('a -> bool) -> 'a t -> 'a t * 'a t
val of_dispenser : (unit -> 'a option) -> 'a t
val to_dispenser : 'a t -> unit -> 'a option
val ints : int -> int t
val nil : 'a t
val empty : 'a t
val cons : 'a -> 'a t -> 'a t
val singleton : 'a -> 'a t
val init : int -> (int -> 'a) -> 'a t

init n f corresponds to the sequence f 0; f 1; ...; f (n-1).

  • raises Invalid_argument

    if n is negative.

  • since 3.10
val repeat : ?n:int -> 'a -> 'a t

repeat ~n x repeats x n times then stops. If n is omitted, then x is repeated forever.

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

forever f corresponds to the infinite sequence containing all the f ().

  • since 3.10
val cycle : 'a t -> 'a t

Cycle through the iterator infinitely. The iterator shouldn't be empty.

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

iterate f a corresponds to the infinite sequence containing a, f a, f (f a), ...]

  • since 3.10
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t

unfold f acc calls f acc and:

  • if f acc = Some (x, acc'), yield x, continue with unfold f acc'.
  • if f acc = None, stops.
val is_empty : 'a t -> bool

is_empty xs checks in the sequence xs is empty

val head : 'a t -> 'a option

Head of the list.

val head_exn : 'a t -> 'a

Unsafe version of head.

  • raises Not_found

    if the list is empty.

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

Tail of the list.

val tail_exn : 'a t -> 'a t

Unsafe version of tail.

  • raises Not_found

    if the list is empty.

val uncons : 'a t -> ('a * 'a t) option

uncons xs return None if xs is empty other

  • since 3.10
val equal : 'a equal -> 'a t equal

Equality step by step. Eager.

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

Lexicographic comparison. Eager.

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

Fold on values.

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

Alias for fold

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

fold_lefti f init xs applies f acc i x where acc is the result of the previous computation or init for the first one, i is the index in the sequence (starts at 0) and x is the element of the sequence.

  • since 3.10
val fold_lefti : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a

Alias of foldi.

  • since 3.10
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit

Iterate with index (starts at 0).

val length : _ t -> int

Number of elements in the list. Will not terminate if the list if infinite: use (for instance) take to make the list finite if necessary.

val take : int -> 'a t -> 'a t
val take_while : ('a -> bool) -> 'a t -> 'a t
val drop : int -> 'a t -> 'a t
val drop_while : ('a -> bool) -> 'a t -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t

Map with index (starts at 0).

val fmap : ('a -> 'b option) -> 'a t -> 'b t
val filter : ('a -> bool) -> 'a t -> 'a t
val append : 'a t -> 'a t -> 'a t
val product_with : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

Fair product of two (possibly infinite) lists into a new list. Lazy. The first parameter is used to combine each pair of elements.

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

Alias of product_with.

  • since 3.10
val product : 'a t -> 'b t -> ('a * 'b) t

Specialization of product_with producing tuples.

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

group eq l groups together consecutive elements that satisfy eq. Lazy. For instance group (=) [1;1;1;2;2;3;3;1] yields [1;1;1]; [2;2]; [3;3]; [1].

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

uniq eq l returns l but removes consecutive duplicates. Lazy. In other words, if several values that are equal follow one another, only the first of them is kept.

val for_all : ('a -> bool) -> 'a t -> bool

for_all p [a1; ...; an] checks if all elements of the sequence satisfy the predicate p. That is, it returns (p a1) && ... && (p an) for a non-empty list and true if the sequence is empty. It consumes the sequence until it finds an element not satisfying the predicate.

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

exists p [a1; ...; an] checks if at least one element of the sequence satisfies the predicate p. That is, it returns (p a1) || ... || (p an) for a non-empty sequence and false if the list is empty. It consumes the sequence until it finds an element satisfying the predicate.

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

find p [a1; ...; an] return Some ai for the first ai satisfying the predicate p and return None otherwise.

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

find f [a1; ...; an] return Some (f ai) for the first ai such that f ai = Some _ and return None otherwise.

  • since 3.10
val scan : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a t

scan f init xs is the sequence containing the intermediate result of fold f init xs.

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

Alias of flat_map

  • since 3.10
val filter_map : ('a -> 'b option) -> 'a t -> 'b t
val flatten : 'a t t -> 'a t
val concat : 'a t t -> 'a t

Alias of flatten.

  • since 3.10
val range : int -> int -> int t
val (--) : int -> int -> int t

a -- b is the range of integers containing a and b (therefore, never empty).

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

a -- b is the integer range from a to b, where b is excluded.

Operations on two Collections

val fold2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a t -> 'b t -> 'acc

Fold on two collections at once. Stop as soon as one of them ends.

val fold_left2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a t -> 'b t -> 'acc

Alias for fold2.

  • since 3.10
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

Map on two collections at once. Stop as soon as one of the arguments is exhausted.

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

Iterate on two collections at once. Stop as soon as one of them ends.

val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val exists2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val merge : 'a ord -> 'a t -> 'a t -> 'a t

Merge two sorted iterators into a sorted iterator.

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

Alias of merge.

  • since 3.10
val zip : 'a t -> 'b t -> ('a * 'b) t

Combine elements pairwise. Stop as soon as one of the lists stops.

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

Split each tuple in the list.

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

Alias of unzip.

  • since 3.10
val zip_i : 'a t -> (int * 'a) t

zip_i seq zips the index of each element with the element itself.

  • since 3.8

Misc

val sort : cmp:'a ord -> 'a t -> 'a t

Eager sort. Require the iterator to be finite. O(n ln(n)) time and space.

val sort_uniq : cmp:'a ord -> 'a t -> 'a t

Eager sort that removes duplicate values. Require the iterator to be finite. O(n ln(n)) time and space.

val memoize : 'a t -> 'a t

Avoid recomputations by caching intermediate results.

Fair Combinations

val interleave : 'a t -> 'a t -> 'a t

Fair interleaving of both streams.

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

Fair version of flat_map.

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

Fair version of (<*>).

Implementations

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

Infix version of fair_flat_map.

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

Infix version of fair_app.

Infix operators

module Infix : sig ... end
module type MONAD = sig ... end
module Traverse (M : MONAD) : sig ... end

Conversions

val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list

Gather all values into a list.

val of_array : 'a array -> 'a t

Iterate on the array.

val to_array : 'a t -> 'a array

Convert into array.

val to_rev_list : 'a t -> 'a list

Convert to a list, in reverse order. More efficient than to_list.

val to_iter : 'a t -> 'a iter
val to_gen : 'a t -> 'a gen
val of_gen : 'a gen -> 'a t

of_gen g consumes the generator and caches intermediate results.

val of_string : string -> char t

Iterate on characters.

  • since 3.7

IO

val pp : +CCSeq (containers.CCSeq)

Module CCSeq

Helpers for the standard Seq type

See oseq for a richer API.

  • since 3.0
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

include module type of Stdlib.Seq
type !'a t = unit -> 'a node
and !'a node = 'a Stdlib__Seq.node =
  1. | Nil
  2. | Cons of 'a * 'a t
exception Forced_twice
val once : 'a t -> 'a t
val transpose : 'a t t -> 'a t t
val partition_map : ('a -> ('b, 'c) Stdlib.Either.t) -> 'a t -> 'b t * 'c t
val partition : ('a -> bool) -> 'a t -> 'a t * 'a t
val of_dispenser : (unit -> 'a option) -> 'a t
val to_dispenser : 'a t -> unit -> 'a option
val ints : int -> int t
val nil : 'a t
val empty : 'a t
val cons : 'a -> 'a t -> 'a t
val singleton : 'a -> 'a t
val init : int -> (int -> 'a) -> 'a t

init n f corresponds to the sequence f 0; f 1; ...; f (n-1).

  • raises Invalid_argument

    if n is negative.

  • since 3.10
val repeat : ?n:int -> 'a -> 'a t

repeat ~n x repeats x n times then stops. If n is omitted, then x is repeated forever.

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

forever f corresponds to the infinite sequence containing all the f ().

  • since 3.10
val cycle : 'a t -> 'a t

Cycle through the iterator infinitely. The iterator shouldn't be empty.

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

iterate f a corresponds to the infinite sequence containing a, f a, f (f a), ...

  • since 3.10
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t

unfold f acc calls f acc and:

  • if f acc = Some (x, acc'), yield x, continue with unfold f acc'.
  • if f acc = None, stops.
val is_empty : 'a t -> bool

is_empty xs checks in the sequence xs is empty

val head : 'a t -> 'a option

Head of the list.

val head_exn : 'a t -> 'a

Unsafe version of head.

  • raises Not_found

    if the list is empty.

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

Tail of the list.

val tail_exn : 'a t -> 'a t

Unsafe version of tail.

  • raises Not_found

    if the list is empty.

val uncons : 'a t -> ('a * 'a t) option

uncons xs return None if xs is empty other

  • since 3.10
val equal : 'a equal -> 'a t equal

Equality step by step. Eager.

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

Lexicographic comparison. Eager.

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

Fold on values.

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

Alias for fold

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

fold_lefti f init xs applies f acc i x where acc is the result of the previous computation or init for the first one, i is the index in the sequence (starts at 0) and x is the element of the sequence.

  • since 3.10
val fold_lefti : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a

Alias of foldi.

  • since 3.10
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit

Iterate with index (starts at 0).

val length : _ t -> int

Number of elements in the list. Will not terminate if the list if infinite: use (for instance) take to make the list finite if necessary.

val take : int -> 'a t -> 'a t
val take_while : ('a -> bool) -> 'a t -> 'a t
val drop : int -> 'a t -> 'a t
val drop_while : ('a -> bool) -> 'a t -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t

Map with index (starts at 0).

val fmap : ('a -> 'b option) -> 'a t -> 'b t
val filter : ('a -> bool) -> 'a t -> 'a t
val append : 'a t -> 'a t -> 'a t
val product_with : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

Fair product of two (possibly infinite) lists into a new list. Lazy. The first parameter is used to combine each pair of elements.

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

Alias of product_with.

  • since 3.10
val product : 'a t -> 'b t -> ('a * 'b) t

Specialization of product_with producing tuples.

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

group eq l groups together consecutive elements that satisfy eq. Lazy. For instance group (=) [1;1;1;2;2;3;3;1] yields [1;1;1]; [2;2]; [3;3]; [1].

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

uniq eq l returns l but removes consecutive duplicates. Lazy. In other words, if several values that are equal follow one another, only the first of them is kept.

val for_all : ('a -> bool) -> 'a t -> bool

for_all p [a1; ...; an] checks if all elements of the sequence satisfy the predicate p. That is, it returns (p a1) && ... && (p an) for a non-empty list and true if the sequence is empty. It consumes the sequence until it finds an element not satisfying the predicate.

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

exists p [a1; ...; an] checks if at least one element of the sequence satisfies the predicate p. That is, it returns (p a1) || ... || (p an) for a non-empty sequence and false if the list is empty. It consumes the sequence until it finds an element satisfying the predicate.

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

find p [a1; ...; an] return Some ai for the first ai satisfying the predicate p and return None otherwise.

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

find f [a1; ...; an] return Some (f ai) for the first ai such that f ai = Some _ and return None otherwise.

  • since 3.10
val scan : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a t

scan f init xs is the sequence containing the intermediate result of fold f init xs.

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

Alias of flat_map

  • since 3.10
val filter_map : ('a -> 'b option) -> 'a t -> 'b t
val flatten : 'a t t -> 'a t
val concat : 'a t t -> 'a t

Alias of flatten.

  • since 3.10
val range : int -> int -> int t
val (--) : int -> int -> int t

a -- b is the range of integers containing a and b (therefore, never empty).

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

a -- b is the integer range from a to b, where b is excluded.

Operations on two Collections

val fold2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a t -> 'b t -> 'acc

Fold on two collections at once. Stop as soon as one of them ends.

val fold_left2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a t -> 'b t -> 'acc

Alias for fold2.

  • since 3.10
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

Map on two collections at once. Stop as soon as one of the arguments is exhausted.

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

Iterate on two collections at once. Stop as soon as one of them ends.

val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val exists2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val merge : 'a ord -> 'a t -> 'a t -> 'a t

Merge two sorted iterators into a sorted iterator.

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

Alias of merge.

  • since 3.10
val zip : 'a t -> 'b t -> ('a * 'b) t

Combine elements pairwise. Stop as soon as one of the lists stops.

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

Split each tuple in the list.

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

Alias of unzip.

  • since 3.10
val zip_i : 'a t -> (int * 'a) t

zip_i seq zips the index of each element with the element itself.

  • since 3.8

Misc

val sort : cmp:'a ord -> 'a t -> 'a t

Eager sort. Require the iterator to be finite. O(n ln(n)) time and space.

val sort_uniq : cmp:'a ord -> 'a t -> 'a t

Eager sort that removes duplicate values. Require the iterator to be finite. O(n ln(n)) time and space.

val memoize : 'a t -> 'a t

Avoid recomputations by caching intermediate results.

Fair Combinations

val interleave : 'a t -> 'a t -> 'a t

Fair interleaving of both streams.

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

Fair version of flat_map.

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

Fair version of (<*>).

Implementations

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

Infix version of fair_flat_map.

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

Infix version of fair_app.

Infix operators

module Infix : sig ... end
module type MONAD = sig ... end
module Traverse (M : MONAD) : sig ... end

Conversions

val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list

Gather all values into a list.

val of_array : 'a array -> 'a t

Iterate on the array.

val to_array : 'a t -> 'a array

Convert into array.

val to_rev_list : 'a t -> 'a list

Convert to a list, in reverse order. More efficient than to_list.

val to_iter : 'a t -> 'a iter
val to_gen : 'a t -> 'a gen
val of_gen : 'a gen -> 'a t

of_gen g consumes the generator and caches intermediate results.

val of_string : string -> char t

Iterate on characters.

  • since 3.7

IO

val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> diff --git a/dev/containers/CCSeq/module-type-MONAD/index.html b/dev/containers/CCSeq/module-type-MONAD/index.html new file mode 100644 index 00000000..25807aff --- /dev/null +++ b/dev/containers/CCSeq/module-type-MONAD/index.html @@ -0,0 +1,2 @@ + +MONAD (containers.CCSeq.MONAD)

Module type CCSeq.MONAD

Monadic Operations

type 'a t
val return : 'a -> 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
\ 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..597f30e5 --- /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/CCString/Find/index.html b/dev/containers/CCString/Find/index.html new file mode 100644 index 00000000..5e8f36e8 --- /dev/null +++ b/dev/containers/CCString/Find/index.html @@ -0,0 +1,2 @@ + +Find (containers.CCString.Find)

Module CCString.Find

type _ pattern
val compile : string -> [ `Direct ] pattern
val rcompile : string -> [ `Reverse ] pattern
val find : ?start:int -> pattern:[ `Direct ] pattern -> string -> int

find ~start ~pattern s searches for pattern in the string s, left-to-right.

  • returns

    the offset of the first match, -1 otherwise.

  • parameter start

    offset in string at which we start.

val rfind : ?start:int -> pattern:[ `Reverse ] pattern -> string -> int

rfind ~start ~pattern s searches for pattern in the string s, right-to-left.

  • returns

    the offset of the start of the first match from the right, -1 otherwise.

  • parameter start

    right-offset in string at which we start.

\ No newline at end of file diff --git a/dev/containers/CCString/Infix/index.html b/dev/containers/CCString/Infix/index.html new file mode 100644 index 00000000..060b174b --- /dev/null +++ b/dev/containers/CCString/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCString.Infix)

Module CCString.Infix

val (=) : t -> t -> bool
  • since 3.0
val (<>) : t -> t -> bool
  • since 3.0
val (<) : t -> t -> bool
  • since 3.0
val (<=) : t -> t -> bool
  • since 3.0
val (>=) : t -> t -> bool
  • since 3.0
val (>) : t -> t -> bool
  • since 3.0
\ No newline at end of file diff --git a/dev/containers/CCString/Split/index.html b/dev/containers/CCString/Split/index.html new file mode 100644 index 00000000..fe188fac --- /dev/null +++ b/dev/containers/CCString/Split/index.html @@ -0,0 +1,18 @@ + +Split (containers.CCString.Split)

Module CCString.Split

type drop_if_empty = {
  1. first : bool;
  2. last : bool;
}

Specification of what to do with empty blocks, as in split ~by:"-" "-a-b-".

  • {first=false; last=false} will return ""; "a"; "b"; ""
  • {first=true; last=false} will return "a"; "b" ""
  • {first=false; last=true} will return ""; "a"; "b"
  • {first=true; last=true} will return "a"; "b"

The default value of all remaining functions is Drop_none.

  • since 1.5
val no_drop : drop_if_empty

no_drop does not drop any group, even empty and on borders.

  • since 1.5
val list_ : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) list

list_ ~drop ~by s splits the given string s along the given separator by. Should only be used with very small separators.

  • returns

    a list of slices (s,index,length) that are separated by by. String.sub can then be used to actually extract a string from the slice.

  • raises Failure

    if by = "".

val gen : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) gen

gen ~drop ~by s splits the given string s along the given separator by. Returns a gen of slices.

val iter : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) iter

iter ~drop ~by s splits the given string s along the given separator by. Returns an iter of slices.

  • since 2.8
val seq : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) Stdlib.Seq.t

seq ~drop ~by s splits the given string s along the given separator by. Returns a Seq.t of slices. Renamed from std_seq since 3.0.

  • since 3.0
Copying functions

Those split functions actually copy the substrings, which can be more convenient but less efficient in general.

val list_cpy : ?drop:drop_if_empty -> by:string -> string -> string list

list_cpy ~drop ~by s splits the given string s along the given separator by. Returns a list of strings.

val gen_cpy : ?drop:drop_if_empty -> by:string -> string -> string gen

gen_cpy ~drop ~by s splits the given string s along the given separator by. Returns a gen of strings.

val iter_cpy : ?drop:drop_if_empty -> by:string -> string -> string iter

iter_cpy ~drop ~by s splits the given string s along the given separator by. Returns an iter of strings.

  • since 2.8
val seq_cpy : ?drop:drop_if_empty -> by:string -> string -> string Stdlib.Seq.t

seq_cpy ~drop ~by s splits the given string s along the given separator by. Returns a Seq.t of strings. Renamed from std_seq_cpy since 3.0.

  • since 3.0
val left : by:string -> string -> (string * string) option

left ~by s splits on the first occurrence of by from the leftmost part of the string s.

  • since 0.12
val left_exn : by:string -> string -> string * string

left_exn ~by s splits on the first occurrence of by from the leftmost part of the string s.

  • raises Not_found

    if by is not part of the string s.

  • since 0.16
val right : by:string -> string -> (string * string) option

right ~by s splits on the first occurrence of by from the rightmost part of the string s.

  • since 0.12
val right_exn : by:string -> string -> string * string

right_exn ~by s splits on the first occurrence of by from the rightmost part of the string s.

  • raises Not_found

    if by is not part of the string s.

  • since 0.16
\ No newline at end of file diff --git a/dev/containers/CCStringLabels/Find/index.html b/dev/containers/CCStringLabels/Find/index.html new file mode 100644 index 00000000..34a5b98a --- /dev/null +++ b/dev/containers/CCStringLabels/Find/index.html @@ -0,0 +1,2 @@ + +Find (containers.CCStringLabels.Find)

Module CCStringLabels.Find

type _ pattern
val compile : string -> [ `Direct ] pattern
val rcompile : string -> [ `Reverse ] pattern
val find : ?start:int -> pattern:[ `Direct ] pattern -> string -> int

find ?start ~pattern s searches for pattern in the string s, left-to-right.

  • returns

    the offset of the first match, -1 otherwise.

  • parameter start

    offset in string at which we start.

val rfind : ?start:int -> pattern:[ `Reverse ] pattern -> string -> int

rfind ?start ~pattern s searches for pattern in the string s, right-to-left.

  • returns

    the offset of the start of the first match from the right, -1 otherwise.

  • parameter start

    right-offset in string at which we start.

\ No newline at end of file diff --git a/dev/containers/CCStringLabels/Infix/index.html b/dev/containers/CCStringLabels/Infix/index.html new file mode 100644 index 00000000..53c7879a --- /dev/null +++ b/dev/containers/CCStringLabels/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCStringLabels.Infix)

Module CCStringLabels.Infix

val (=) : t -> t -> bool
  • since 3.0
val (<>) : t -> t -> bool
  • since 3.0
val (<) : t -> t -> bool
  • since 3.0
val (<=) : t -> t -> bool
  • since 3.0
val (>=) : t -> t -> bool
  • since 3.0
val (>) : t -> t -> bool
  • since 3.0
\ No newline at end of file diff --git a/dev/containers/CCStringLabels/Split/index.html b/dev/containers/CCStringLabels/Split/index.html new file mode 100644 index 00000000..269294a2 --- /dev/null +++ b/dev/containers/CCStringLabels/Split/index.html @@ -0,0 +1,18 @@ + +Split (containers.CCStringLabels.Split)

Module CCStringLabels.Split

type drop_if_empty = {
  1. first : bool;
  2. last : bool;
}

Specification of what to do with empty blocks, as in split ~by:"-" "-a-b-".

  • {first=false; last=false} will return ""; "a"; "b"; ""
  • {first=true; last=false} will return "a"; "b" ""
  • {first=false; last=true} will return ""; "a"; "b"
  • {first=true; last=true} will return "a"; "b"

The default value of all remaining functions is Drop_none.

  • since 1.5
val no_drop : drop_if_empty

no_drop does not drop any group, even empty and on borders.

  • since 1.5
val list_ : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) list

list_ ?drop ~by s splits the given string s along the given separator by. Should only be used with very small separators.

  • returns

    a list of slices (s,index,length) that are separated by by. String.sub can then be used to actually extract a string from the slice.

  • raises Failure

    if by = "".

val gen : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) gen

gen ?drop ~by s splits the given string s along the given separator by. Returns a gen of slices.

val iter : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) iter

iter ?drop ~by s splits the given string s along the given separator by. Returns an iter of slices.

  • since 2.8
val seq : + ?drop:drop_if_empty -> + by:string -> + string -> + (string * int * int) Stdlib.Seq.t

seq ?drop ~by s splits the given string s along the given separator by. Returns a Seq.t of slices. Renamed from std_seq since 3.0.

  • since 3.0
Copying functions

Those split functions actually copy the substrings, which can be more convenient but less efficient in general.

val list_cpy : ?drop:drop_if_empty -> by:string -> string -> string list

list_cpy ?drop ~by s splits the given string s along the given separator by. Returns a list of strings.

val gen_cpy : ?drop:drop_if_empty -> by:string -> string -> string gen

gen_cpy ?drop ~by s splits the given string s along the given separator by. Returns a gen of strings.

val iter_cpy : ?drop:drop_if_empty -> by:string -> string -> string iter

iter_cpy ?drop ~by s splits the given string s along the given separator by. Returns an iter of strings.

  • since 2.8
val seq_cpy : ?drop:drop_if_empty -> by:string -> string -> string Stdlib.Seq.t

seq_cpy ?drop ~by s splits the given string s along the given separator by. Returns a Seq.t of strings. Renamed from std_seq_cpy since 3.0.

  • since 3.0
val left : by:string -> string -> (string * string) option

left ~by s splits on the first occurrence of by from the leftmost part of the string s.

  • since 0.12
val left_exn : by:string -> string -> string * string

left_exn ~by s splits on the first occurrence of by from the leftmost part of the string s.

  • raises Not_found

    if by is not part of the string s.

  • since 0.16
val right : by:string -> string -> (string * string) option

right ~by s splits on the first occurrence of by from the rightmost part of the string s.

  • since 0.12
val right_exn : by:string -> string -> string * string

right_exn ~by s splits on the first occurrence of by from the rightmost part of the string s.

  • raises Not_found

    if by is not part of the string s.

  • since 0.16
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/Make/index.html b/dev/containers/Containers/Hashtbl/Make/index.html new file mode 100644 index 00000000..6e6b17bc --- /dev/null +++ b/dev/containers/Containers/Hashtbl/Make/index.html @@ -0,0 +1,2 @@ + +Make (containers.Containers.Hashtbl.Make)

Module Hashtbl.Make

Parameters

module H : sig ... end

Signature

type key = H.t
type !'a t = 'a Stdlib__Hashtbl.Make(H).t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Stdlib__Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html b/dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html new file mode 100644 index 00000000..c38b29c2 --- /dev/null +++ b/dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html @@ -0,0 +1,2 @@ + +H (containers.Containers.Hashtbl.MakeSeeded.H)

Parameter MakeSeeded.H

type t
val equal : t -> t -> bool
val hash : int -> t -> int
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/MakeSeeded/index.html b/dev/containers/Containers/Hashtbl/MakeSeeded/index.html new file mode 100644 index 00000000..144fd4a4 --- /dev/null +++ b/dev/containers/Containers/Hashtbl/MakeSeeded/index.html @@ -0,0 +1,2 @@ + +MakeSeeded (containers.Containers.Hashtbl.MakeSeeded)

Module Hashtbl.MakeSeeded

Parameters

Signature

type key = H.t
type !'a t = 'a Stdlib__Hashtbl.MakeSeeded(H).t
val create : ?random:bool -> int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/index.html b/dev/containers/Containers/Hashtbl/index.html new file mode 100644 index 00000000..6f7d4547 --- /dev/null +++ b/dev/containers/Containers/Hashtbl/index.html @@ -0,0 +1,33 @@ + +Hashtbl (containers.Containers.Hashtbl)

Module Containers.Hashtbl

  • since 0.14
include module type of Stdlib.Hashtbl + with type statistics = Stdlib.Hashtbl.statistics + and module Make = Stdlib.Hashtbl.Make + and type ('a, 'b) t = ('a, 'b) Stdlib.Hashtbl.t
type (!'a0, !'b0) t = ('a, 'b) Stdlib.Hashtbl.t
val create : ?random:bool -> int -> ('a, 'b) t
val clear : ('a, 'b) t -> unit
val reset : ('a, 'b) t -> unit
val copy : ('a, 'b) t -> ('a, 'b) t
val add : ('a, 'b) t -> 'a -> 'b -> unit
val find : ('a, 'b) t -> 'a -> 'b
val find_opt : ('a, 'b) t -> 'a -> 'b option
val find_all : ('a, 'b) t -> 'a -> 'b list
val mem : ('a, 'b) t -> 'a -> bool
val remove : ('a, 'b) t -> 'a -> unit
val replace : ('a, 'b) t -> 'a -> 'b -> unit
val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
val filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unit
val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
val length : ('a, 'b) t -> int
val randomize : unit -> unit
val is_randomized : unit -> bool
val rebuild : ?random:bool -> ('a, 'b) t -> ('a, 'b) t
type statistics = Stdlib.Hashtbl.statistics = {
  1. num_bindings : int;
  2. num_buckets : int;
  3. max_bucket_length : int;
  4. bucket_histogram : int array;
}
val stats : ('a, 'b) t -> statistics
val to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t
val to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.t
val to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.t
val replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unit
module type HashedType = sig ... end
module type S = sig ... end
module Make (H : sig ... end) : sig ... end
module type SeededHashedType = sig ... end
module type SeededS = sig ... end
module MakeSeeded (H : SeededHashedType) : sig ... end
val hash : 'a -> int
val seeded_hash : int -> 'a -> int
val hash_param : int -> int -> 'a -> int
val seeded_hash_param : int -> int -> int -> 'a -> int
include module type of struct include CCHashtbl.Poly end
val get : ('a, 'b) Stdlib.Hashtbl.t -> 'a -> 'b option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

val get_or : ('a, 'b) Stdlib.Hashtbl.t -> 'a -> default:'b -> 'b

get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).

  • since 0.16
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.iter

values tbl f iterates on values in the table tbl.

val keys_list : ('a, 'b) Stdlib.Hashtbl.t -> 'a list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : ('a, 'b) Stdlib.Hashtbl.t -> 'b list

values_list tbl is the list of values in tbl.

  • since 0.8
val map_list : ('a -> 'b -> 'c) -> ('a, 'b) Stdlib.Hashtbl.t -> 'c list

map_list f tbl maps on a tbl's items. Collect into a list.

val incr : ?by:int -> ('a, int) Stdlib.Hashtbl.t -> 'a -> unit

incr ?by tbl x increments or initializes the counter associated with x. If get tbl x = None, then after update, get tbl x = Some 1; otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> ('a, int) Stdlib.Hashtbl.t -> 'a -> unit

decr ?by tbl x is like incr but subtract 1 (or the value of by). If the value reaches 0, the key is removed from the table. This does nothing if the key is not already present in the table.

  • since 0.16
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter

Iterate on bindings in the table.

  • since 2.8
val add_list : ('a, 'b list) Stdlib.Hashtbl.t -> 'a -> 'b -> unit

add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.

  • since 0.16
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • since 2.8
val add_iter_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a, 'b) Stdlib.Hashtbl.t -> + ('a * 'b) CCHashtbl.iter -> + unit

Add the corresponding pairs to the table, using Hashtbl.add. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val add_seq : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) Stdlib.Seq.t -> unit

Add the corresponding pairs to the table, using Hashtbl.add. Renamed from add_std_seq since 3.0.

  • since 3.0
val add_seq_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a, 'b) Stdlib.Hashtbl.t -> + ('a * 'b) Stdlib.Seq.t -> + unit

Add the corresponding pairs to the table. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val of_iter : ('a * 'b) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order.

  • since 2.8
val of_iter_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a * 'b) CCHashtbl.iter -> + ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val of_seq : ('a * 'b) Stdlib.Seq.t -> ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. Renamed from of_std_seq since 3.0.

  • since 3.0
val of_seq_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a * 'b) Stdlib.Seq.t -> + ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val add_iter_count : ('a, int) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter -> unit

add_iter_count tbl i increments the count of each element of i by calling incr. This is useful for counting how many times each element of i occurs.

  • since 2.8
val add_seq_count : ('a, int) Stdlib.Hashtbl.t -> 'a Stdlib.Seq.t -> unit

add_seq_count tbl seq increments the count of each element of seq by calling incr. This is useful for counting how many times each element of seq occurs. Renamed from add_std_seq_count since 3.0.

  • since 3.0
val of_iter_count : 'a CCHashtbl.iter -> ('a, int) Stdlib.Hashtbl.t

Like add_seq_count, but allocates a new table and returns it.

  • since 2.8
val of_seq_count : 'a Stdlib.Seq.t -> ('a, int) Stdlib.Hashtbl.t

Like add_seq_count, but allocates a new table and returns it. Renamed from of_std_seq_count since 3.0.

  • since 3.0
val to_list : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) list

to_list tbl returns the list of (key,value) bindings (order unspecified).

val of_list : ('a * 'b) list -> ('a, 'b) Stdlib.Hashtbl.t

of_list l builds a table from the given list l of bindings k_i -> v_i, added in order using add. If a key occurs several times, it will be added several times, and the visible binding will be the last one.

val of_list_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a * 'b) list -> + ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val update : + ('a, 'b) Stdlib.Hashtbl.t -> + f:('a -> 'b option -> 'b option) -> + k:'a -> + unit

update tbl ~f ~k updates key k by calling f k (Some v) if k was mapped to v, or f k None otherwise; if the call returns None then k is removed/stays removed, if the call returns Some v' then the binding k -> v' is inserted using Hashtbl.replace.

  • since 0.14
val get_or_add : ('a, 'b) Stdlib.Hashtbl.t -> f:('a -> 'b) -> k:'a -> 'b

get_or_add tbl ~k ~f finds and returns the binding of k in tbl, if it exists. If it does not exist, then f k is called to obtain a new binding v; k -> v is added to tbl and v is returned.

  • since 1.0
val pp : + ?pp_start:unit CCHashtbl.printer -> + ?pp_stop:unit CCHashtbl.printer -> + ?pp_sep:unit CCHashtbl.printer -> + ?pp_arrow:unit CCHashtbl.printer -> + 'a CCHashtbl.printer -> + 'b CCHashtbl.printer -> + ('a, 'b) Stdlib.Hashtbl.t CCHashtbl.printer

pp ~pp_start ~pp_stop ~pp_sep ~pp arrow pp_k pp_v returns a table printer given a pp_k printer for individual key and a pp_v printer for individual value. pp_start and pp_stop control the opening and closing delimiters, by default print nothing. pp_sep control the separator between binding. pp_arrow control the arrow between the key and value. Renamed from print since 2.0.

  • since 0.13
module type S' = CCHashtbl.S
module Make' = CCHashtbl.Make
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html b/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html new file mode 100644 index 00000000..2c6e2e75 --- /dev/null +++ b/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html @@ -0,0 +1,2 @@ + +HashedType (containers.Containers.Hashtbl.HashedType)

Module type Hashtbl.HashedType

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/module-type-S/index.html b/dev/containers/Containers/Hashtbl/module-type-S/index.html new file mode 100644 index 00000000..35b496cd --- /dev/null +++ b/dev/containers/Containers/Hashtbl/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (containers.Containers.Hashtbl.S)

Module type Hashtbl.S

type key
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html b/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html new file mode 100644 index 00000000..9507a795 --- /dev/null +++ b/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html @@ -0,0 +1,2 @@ + +SeededHashedType (containers.Containers.Hashtbl.SeededHashedType)

Module type Hashtbl.SeededHashedType

type t
val equal : t -> t -> bool
val hash : int -> t -> int
\ No newline at end of file diff --git a/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html b/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html new file mode 100644 index 00000000..4f4cdd32 --- /dev/null +++ b/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html @@ -0,0 +1,2 @@ + +SeededS (containers.Containers.Hashtbl.SeededS)

Module type Hashtbl.SeededS

type key
type !'a t
val create : ?random:bool -> int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/Make/index.html b/dev/containers/ContainersLabels/Hashtbl/Make/index.html new file mode 100644 index 00000000..1d941738 --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/Make/index.html @@ -0,0 +1,2 @@ + +Make (containers.ContainersLabels.Hashtbl.Make)

Module Hashtbl.Make

Parameters

module H : sig ... end

Signature

type key = H.t
type !'a t = 'a Stdlib__Hashtbl.Make(H).t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Stdlib__Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/argument-1-H/index.html b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/argument-1-H/index.html new file mode 100644 index 00000000..693f1efc --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/argument-1-H/index.html @@ -0,0 +1,2 @@ + +H (containers.ContainersLabels.Hashtbl.MakeSeeded.H)

Parameter MakeSeeded.H

type t
val equal : t -> t -> bool
val hash : int -> t -> int
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html new file mode 100644 index 00000000..f4f57d7a --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html @@ -0,0 +1,2 @@ + +MakeSeeded (containers.ContainersLabels.Hashtbl.MakeSeeded)

Module Hashtbl.MakeSeeded

Parameters

Signature

type key = H.t
type !'a t = 'a Stdlib__Hashtbl.MakeSeeded(H).t
val create : ?random:bool -> int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/index.html b/dev/containers/ContainersLabels/Hashtbl/index.html new file mode 100644 index 00000000..138bfc7a --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/index.html @@ -0,0 +1,33 @@ + +Hashtbl (containers.ContainersLabels.Hashtbl)

Module ContainersLabels.Hashtbl

  • since 0.14
include module type of Stdlib.Hashtbl + with type statistics = Stdlib.Hashtbl.statistics + and module Make = Stdlib.Hashtbl.Make + and type ('a, 'b) t = ('a, 'b) Stdlib.Hashtbl.t
type (!'a0, !'b0) t = ('a, 'b) Stdlib.Hashtbl.t
val create : ?random:bool -> int -> ('a, 'b) t
val clear : ('a, 'b) t -> unit
val reset : ('a, 'b) t -> unit
val copy : ('a, 'b) t -> ('a, 'b) t
val add : ('a, 'b) t -> 'a -> 'b -> unit
val find : ('a, 'b) t -> 'a -> 'b
val find_opt : ('a, 'b) t -> 'a -> 'b option
val find_all : ('a, 'b) t -> 'a -> 'b list
val mem : ('a, 'b) t -> 'a -> bool
val remove : ('a, 'b) t -> 'a -> unit
val replace : ('a, 'b) t -> 'a -> 'b -> unit
val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
val filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unit
val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
val length : ('a, 'b) t -> int
val randomize : unit -> unit
val is_randomized : unit -> bool
val rebuild : ?random:bool -> ('a, 'b) t -> ('a, 'b) t
type statistics = Stdlib.Hashtbl.statistics = {
  1. num_bindings : int;
  2. num_buckets : int;
  3. max_bucket_length : int;
  4. bucket_histogram : int array;
}
val stats : ('a, 'b) t -> statistics
val to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t
val to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.t
val to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.t
val replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unit
module type HashedType = sig ... end
module type S = sig ... end
module Make (H : sig ... end) : sig ... end
module type SeededHashedType = sig ... end
module type SeededS = sig ... end
module MakeSeeded (H : SeededHashedType) : sig ... end
val hash : 'a -> int
val seeded_hash : int -> 'a -> int
val hash_param : int -> int -> 'a -> int
val seeded_hash_param : int -> int -> int -> 'a -> int
include module type of struct include CCHashtbl.Poly end
val get : ('a, 'b) Stdlib.Hashtbl.t -> 'a -> 'b option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

val get_or : ('a, 'b) Stdlib.Hashtbl.t -> 'a -> default:'b -> 'b

get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).

  • since 0.16
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.iter

values tbl f iterates on values in the table tbl.

val keys_list : ('a, 'b) Stdlib.Hashtbl.t -> 'a list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : ('a, 'b) Stdlib.Hashtbl.t -> 'b list

values_list tbl is the list of values in tbl.

  • since 0.8
val map_list : ('a -> 'b -> 'c) -> ('a, 'b) Stdlib.Hashtbl.t -> 'c list

map_list f tbl maps on a tbl's items. Collect into a list.

val incr : ?by:int -> ('a, int) Stdlib.Hashtbl.t -> 'a -> unit

incr ?by tbl x increments or initializes the counter associated with x. If get tbl x = None, then after update, get tbl x = Some 1; otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> ('a, int) Stdlib.Hashtbl.t -> 'a -> unit

decr ?by tbl x is like incr but subtract 1 (or the value of by). If the value reaches 0, the key is removed from the table. This does nothing if the key is not already present in the table.

  • since 0.16
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter

Iterate on bindings in the table.

  • since 2.8
val add_list : ('a, 'b list) Stdlib.Hashtbl.t -> 'a -> 'b -> unit

add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.

  • since 0.16
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • since 2.8
val add_iter_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a, 'b) Stdlib.Hashtbl.t -> + ('a * 'b) CCHashtbl.iter -> + unit

Add the corresponding pairs to the table, using Hashtbl.add. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val add_seq : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) Stdlib.Seq.t -> unit

Add the corresponding pairs to the table, using Hashtbl.add. Renamed from add_std_seq since 3.0.

  • since 3.0
val add_seq_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a, 'b) Stdlib.Hashtbl.t -> + ('a * 'b) Stdlib.Seq.t -> + unit

Add the corresponding pairs to the table. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val of_iter : ('a * 'b) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order.

  • since 2.8
val of_iter_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a * 'b) CCHashtbl.iter -> + ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val of_seq : ('a * 'b) Stdlib.Seq.t -> ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. Renamed from of_std_seq since 3.0.

  • since 3.0
val of_seq_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a * 'b) Stdlib.Seq.t -> + ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val add_iter_count : ('a, int) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter -> unit

add_iter_count tbl i increments the count of each element of i by calling incr. This is useful for counting how many times each element of i occurs.

  • since 2.8
val add_seq_count : ('a, int) Stdlib.Hashtbl.t -> 'a Stdlib.Seq.t -> unit

add_seq_count tbl seq increments the count of each element of seq by calling incr. This is useful for counting how many times each element of seq occurs. Renamed from add_std_seq_count since 3.0.

  • since 3.0
val of_iter_count : 'a CCHashtbl.iter -> ('a, int) Stdlib.Hashtbl.t

Like add_seq_count, but allocates a new table and returns it.

  • since 2.8
val of_seq_count : 'a Stdlib.Seq.t -> ('a, int) Stdlib.Hashtbl.t

Like add_seq_count, but allocates a new table and returns it. Renamed from of_std_seq_count since 3.0.

  • since 3.0
val to_list : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) list

to_list tbl returns the list of (key,value) bindings (order unspecified).

val of_list : ('a * 'b) list -> ('a, 'b) Stdlib.Hashtbl.t

of_list l builds a table from the given list l of bindings k_i -> v_i, added in order using add. If a key occurs several times, it will be added several times, and the visible binding will be the last one.

val of_list_with : + f:('a -> 'b -> 'b -> 'b) -> + ('a * 'b) list -> + ('a, 'b) Stdlib.Hashtbl.t

From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.

  • since 3.3
val update : + ('a, 'b) Stdlib.Hashtbl.t -> + f:('a -> 'b option -> 'b option) -> + k:'a -> + unit

update tbl ~f ~k updates key k by calling f k (Some v) if k was mapped to v, or f k None otherwise; if the call returns None then k is removed/stays removed, if the call returns Some v' then the binding k -> v' is inserted using Hashtbl.replace.

  • since 0.14
val get_or_add : ('a, 'b) Stdlib.Hashtbl.t -> f:('a -> 'b) -> k:'a -> 'b

get_or_add tbl ~k ~f finds and returns the binding of k in tbl, if it exists. If it does not exist, then f k is called to obtain a new binding v; k -> v is added to tbl and v is returned.

  • since 1.0
val pp : + ?pp_start:unit CCHashtbl.printer -> + ?pp_stop:unit CCHashtbl.printer -> + ?pp_sep:unit CCHashtbl.printer -> + ?pp_arrow:unit CCHashtbl.printer -> + 'a CCHashtbl.printer -> + 'b CCHashtbl.printer -> + ('a, 'b) Stdlib.Hashtbl.t CCHashtbl.printer

pp ~pp_start ~pp_stop ~pp_sep ~pp arrow pp_k pp_v returns a table printer given a pp_k printer for individual key and a pp_v printer for individual value. pp_start and pp_stop control the opening and closing delimiters, by default print nothing. pp_sep control the separator between binding. pp_arrow control the arrow between the key and value. Renamed from print since 2.0.

  • since 0.13
module type S' = CCHashtbl.S
module Make' = CCHashtbl.Make
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html b/dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html new file mode 100644 index 00000000..3ec52428 --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html @@ -0,0 +1,2 @@ + +HashedType (containers.ContainersLabels.Hashtbl.HashedType)

Module type Hashtbl.HashedType

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/module-type-S/index.html b/dev/containers/ContainersLabels/Hashtbl/module-type-S/index.html new file mode 100644 index 00000000..f989e23e --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (containers.ContainersLabels.Hashtbl.S)

Module type Hashtbl.S

type key
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/module-type-SeededHashedType/index.html b/dev/containers/ContainersLabels/Hashtbl/module-type-SeededHashedType/index.html new file mode 100644 index 00000000..bfbd7878 --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-SeededHashedType/index.html @@ -0,0 +1,2 @@ + +SeededHashedType (containers.ContainersLabels.Hashtbl.SeededHashedType)

Module type Hashtbl.SeededHashedType

type t
val equal : t -> t -> bool
val hash : int -> t -> int
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/module-type-SeededS/index.html b/dev/containers/ContainersLabels/Hashtbl/module-type-SeededS/index.html new file mode 100644 index 00000000..e98dedef --- /dev/null +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-SeededS/index.html @@ -0,0 +1,2 @@ + +SeededS (containers.ContainersLabels.Hashtbl.SeededS)

Module type Hashtbl.SeededS

type key
type !'a t
val create : ?random:bool -> int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
\ No newline at end of file