From 3e735be3725a29eb04521e2d8b6e6baac56ebb5f Mon Sep 17 00:00:00 2001 From: c-cube Date: Wed, 6 Jul 2022 20:46:13 +0000 Subject: [PATCH] deploy: 484aa3a1e75e29b3576f8b0fc7ea6073f3021e6e --- dev/containers-data/CCBV/index.html | 3 ++- dev/containers-data/CCBijection/Make/argument-1-L/index.html | 2 +- dev/containers-data/CCBijection/Make/argument-2-R/index.html | 2 +- dev/containers-data/CCBijection/Make/index.html | 2 +- dev/containers-data/CCBijection/index.html | 2 +- .../CCBijection/module-type-OrderedType/index.html | 2 +- dev/containers-data/CCBijection/module-type-S/index.html | 2 +- dev/containers-data/CCBitField/Make/argument-1-_/index.html | 2 +- dev/containers-data/CCBitField/Make/index.html | 2 +- dev/containers-data/CCBitField/index.html | 2 +- dev/containers-data/CCBitField/module-type-S/index.html | 2 +- dev/containers-data/CCCache/index.html | 2 +- dev/containers-data/CCDeque/index.html | 2 +- dev/containers-data/CCFQueue/index.html | 2 +- dev/containers-data/CCFun_vec/index.html | 2 +- dev/containers-data/CCGraph/Dot/index.html | 2 +- dev/containers-data/CCGraph/Iter/index.html | 2 +- dev/containers-data/CCGraph/Lazy_tree/index.html | 2 +- dev/containers-data/CCGraph/Map/index.html | 2 +- dev/containers-data/CCGraph/Traverse/Event/index.html | 2 +- dev/containers-data/CCGraph/Traverse/index.html | 2 +- dev/containers-data/CCGraph/index.html | 2 +- dev/containers-data/CCGraph/module-type-MAP/index.html | 2 +- dev/containers-data/CCHashSet/Make/argument-1-E/index.html | 2 +- dev/containers-data/CCHashSet/Make/index.html | 2 +- dev/containers-data/CCHashSet/index.html | 2 +- dev/containers-data/CCHashSet/module-type-ELEMENT/index.html | 2 +- dev/containers-data/CCHashSet/module-type-S/index.html | 2 +- dev/containers-data/CCHashTrie/Make/argument-1-K/index.html | 2 +- dev/containers-data/CCHashTrie/Make/index.html | 2 +- dev/containers-data/CCHashTrie/Transient/index.html | 2 +- dev/containers-data/CCHashTrie/index.html | 2 +- dev/containers-data/CCHashTrie/module-type-KEY/index.html | 2 +- dev/containers-data/CCHashTrie/module-type-S/index.html | 2 +- dev/containers-data/CCHet/Key/index.html | 2 +- dev/containers-data/CCHet/Map/index.html | 2 +- dev/containers-data/CCHet/Tbl/index.html | 2 +- dev/containers-data/CCHet/index.html | 2 +- dev/containers-data/CCImmutArray/index.html | 2 +- dev/containers-data/CCIntMap/index.html | 2 +- dev/containers-data/CCKTree/Dot/index.html | 2 +- dev/containers-data/CCKTree/class-type-pset/index.html | 2 +- dev/containers-data/CCKTree/index.html | 2 +- dev/containers-data/CCLazy_list/Infix/index.html | 2 +- dev/containers-data/CCLazy_list/index.html | 2 +- dev/containers-data/CCMixmap/Make/argument-1-X/index.html | 2 +- dev/containers-data/CCMixmap/Make/index.html | 2 +- dev/containers-data/CCMixmap/index.html | 2 +- dev/containers-data/CCMixmap/module-type-ORD/index.html | 2 +- dev/containers-data/CCMixmap/module-type-S/index.html | 2 +- dev/containers-data/CCMixset/index.html | 2 +- dev/containers-data/CCMixtbl/index.html | 2 +- dev/containers-data/CCMultiMap/Make/argument-1-K/index.html | 2 +- dev/containers-data/CCMultiMap/Make/argument-2-V/index.html | 2 +- dev/containers-data/CCMultiMap/Make/index.html | 2 +- .../CCMultiMap/MakeBidir/argument-1-L/index.html | 2 +- .../CCMultiMap/MakeBidir/argument-2-R/index.html | 2 +- dev/containers-data/CCMultiMap/MakeBidir/index.html | 2 +- dev/containers-data/CCMultiMap/index.html | 2 +- dev/containers-data/CCMultiMap/module-type-BIDIR/index.html | 2 +- .../CCMultiMap/module-type-OrderedType/index.html | 2 +- dev/containers-data/CCMultiMap/module-type-S/index.html | 2 +- dev/containers-data/CCMultiSet/Make/index.html | 2 +- dev/containers-data/CCMultiSet/index.html | 2 +- dev/containers-data/CCMultiSet/module-type-S/index.html | 2 +- dev/containers-data/CCMutHeap/Make/argument-1-X/index.html | 2 +- dev/containers-data/CCMutHeap/Make/index.html | 2 +- dev/containers-data/CCMutHeap/index.html | 2 +- dev/containers-data/CCMutHeap_intf/index.html | 2 +- .../CCMutHeap_intf/module-type-RANKED/index.html | 2 +- dev/containers-data/CCMutHeap_intf/module-type-S/index.html | 2 +- dev/containers-data/CCPersistentArray/index.html | 2 +- .../CCPersistentHashtbl/Make/argument-1-H/index.html | 2 +- dev/containers-data/CCPersistentHashtbl/Make/index.html | 2 +- dev/containers-data/CCPersistentHashtbl/index.html | 2 +- .../CCPersistentHashtbl/module-type-HashedType/index.html | 2 +- .../CCPersistentHashtbl/module-type-S/index.html | 2 +- dev/containers-data/CCRAL/Infix/index.html | 2 +- dev/containers-data/CCRAL/index.html | 2 +- dev/containers-data/CCRingBuffer/Array/Byte/index.html | 2 +- .../CCRingBuffer/Array/Make/argument-1-Elt/index.html | 2 +- dev/containers-data/CCRingBuffer/Array/Make/index.html | 2 +- dev/containers-data/CCRingBuffer/Array/index.html | 2 +- .../CCRingBuffer/Array/module-type-S/index.html | 2 +- dev/containers-data/CCRingBuffer/Byte/index.html | 2 +- dev/containers-data/CCRingBuffer/Make/Array/index.html | 2 +- dev/containers-data/CCRingBuffer/Make/argument-1-X/index.html | 2 +- dev/containers-data/CCRingBuffer/Make/index.html | 2 +- .../CCRingBuffer/MakeFromArray/argument-1-A/index.html | 2 +- dev/containers-data/CCRingBuffer/MakeFromArray/index.html | 2 +- dev/containers-data/CCRingBuffer/index.html | 2 +- .../CCRingBuffer/module-type-S/Array/index.html | 2 +- dev/containers-data/CCRingBuffer/module-type-S/index.html | 2 +- dev/containers-data/CCSimple_queue/Infix/index.html | 2 +- dev/containers-data/CCSimple_queue/index.html | 2 +- dev/containers-data/CCTrie/Make/argument-1-W/index.html | 2 +- dev/containers-data/CCTrie/Make/index.html | 2 +- dev/containers-data/CCTrie/MakeArray/argument-1-X/index.html | 2 +- dev/containers-data/CCTrie/MakeArray/index.html | 2 +- dev/containers-data/CCTrie/MakeList/argument-1-X/index.html | 2 +- dev/containers-data/CCTrie/MakeList/index.html | 2 +- dev/containers-data/CCTrie/String/index.html | 2 +- dev/containers-data/CCTrie/index.html | 2 +- dev/containers-data/CCTrie/module-type-ORDERED/index.html | 2 +- dev/containers-data/CCTrie/module-type-S/index.html | 2 +- dev/containers-data/CCTrie/module-type-WORD/index.html | 2 +- dev/containers-data/CCWBTree/Make/argument-1-X/index.html | 2 +- dev/containers-data/CCWBTree/Make/index.html | 2 +- dev/containers-data/CCWBTree/MakeFull/argument-1-X/index.html | 2 +- dev/containers-data/CCWBTree/MakeFull/index.html | 2 +- dev/containers-data/CCWBTree/index.html | 2 +- dev/containers-data/CCWBTree/module-type-KEY/index.html | 2 +- dev/containers-data/CCWBTree/module-type-ORD/index.html | 2 +- dev/containers-data/CCWBTree/module-type-S/index.html | 2 +- dev/containers-data/CCZipper/index.html | 2 +- dev/containers-data/Containers_data_top/index.html | 2 +- dev/containers-data/index.html | 2 +- dev/containers-thread/CCBlockingQueue/index.html | 2 +- dev/containers-thread/CCLock/LockRef/index.html | 2 +- dev/containers-thread/CCLock/index.html | 2 +- dev/containers-thread/CCPool/Make/Fut/Infix/index.html | 2 +- dev/containers-thread/CCPool/Make/Fut/index.html | 2 +- dev/containers-thread/CCPool/Make/argument-1-P/index.html | 2 +- dev/containers-thread/CCPool/Make/index.html | 2 +- dev/containers-thread/CCPool/index.html | 2 +- dev/containers-thread/CCPool/module-type-PARAM/index.html | 2 +- dev/containers-thread/CCSemaphore/index.html | 2 +- dev/containers-thread/CCThread/Arr/index.html | 2 +- dev/containers-thread/CCThread/Barrier/index.html | 2 +- dev/containers-thread/CCThread/index.html | 2 +- dev/containers-thread/CCTimer/index.html | 2 +- dev/containers-thread/index.html | 2 +- dev/containers/CCArray/Floatarray/index.html | 2 +- dev/containers/CCArray/Infix/index.html | 2 +- dev/containers/CCArray/index.html | 2 +- dev/containers/CCArray/module-type-MONO_ARRAY/index.html | 2 +- dev/containers/CCArrayLabels/Floatarray/index.html | 2 +- dev/containers/CCArrayLabels/Infix/index.html | 2 +- dev/containers/CCArrayLabels/index.html | 2 +- dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html | 2 +- dev/containers/CCAtomic/index.html | 2 +- dev/containers/CCBool/index.html | 2 +- dev/containers/CCByte_buffer/index.html | 2 +- .../CCCanonical_sexp/Make/argument-1-Sexp/index.html | 2 +- dev/containers/CCCanonical_sexp/Make/index.html | 2 +- dev/containers/CCCanonical_sexp/index.html | 2 +- dev/containers/CCChar/Infix/index.html | 2 +- dev/containers/CCChar/index.html | 2 +- dev/containers/CCEither/index.html | 2 +- dev/containers/CCEqual/Infix/index.html | 2 +- dev/containers/CCEqual/index.html | 2 +- dev/containers/CCEqualLabels/Infix/index.html | 2 +- dev/containers/CCEqualLabels/index.html | 2 +- dev/containers/CCFloat/Infix/index.html | 2 +- dev/containers/CCFloat/index.html | 2 +- dev/containers/CCFormat/ANSI_codes/index.html | 2 +- dev/containers/CCFormat/Dump/index.html | 2 +- dev/containers/CCFormat/Infix/index.html | 2 +- dev/containers/CCFormat/index.html | 2 +- dev/containers/CCFun/Infix/index.html | 2 +- dev/containers/CCFun/Monad/argument-1-X/index.html | 2 +- dev/containers/CCFun/Monad/index.html | 2 +- dev/containers/CCFun/index.html | 2 +- dev/containers/CCHash/index.html | 2 +- dev/containers/CCHashtbl/Make/index.html | 2 +- dev/containers/CCHashtbl/Poly/index.html | 2 +- dev/containers/CCHashtbl/index.html | 2 +- dev/containers/CCHashtbl/module-type-S/index.html | 2 +- dev/containers/CCHeap/Make/argument-1-E/index.html | 2 +- dev/containers/CCHeap/Make/index.html | 2 +- .../CCHeap/Make_from_compare/argument-1-E/index.html | 2 +- dev/containers/CCHeap/Make_from_compare/index.html | 2 +- dev/containers/CCHeap/index.html | 2 +- dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html | 2 +- dev/containers/CCHeap/module-type-S/index.html | 2 +- dev/containers/CCHeap/module-type-TOTAL_ORD/index.html | 2 +- dev/containers/CCIO/File/index.html | 2 +- dev/containers/CCIO/index.html | 2 +- dev/containers/CCInt/Infix/index.html | 2 +- dev/containers/CCInt/index.html | 2 +- dev/containers/CCInt32/Infix/index.html | 2 +- dev/containers/CCInt32/index.html | 2 +- dev/containers/CCInt64/Infix/index.html | 2 +- dev/containers/CCInt64/index.html | 2 +- dev/containers/CCList/Assoc/index.html | 2 +- dev/containers/CCList/Infix/index.html | 2 +- dev/containers/CCList/Ref/index.html | 2 +- dev/containers/CCList/Traverse/argument-1-M/index.html | 2 +- dev/containers/CCList/Traverse/index.html | 2 +- dev/containers/CCList/index.html | 2 +- dev/containers/CCList/module-type-MONAD/index.html | 2 +- dev/containers/CCListLabels/Assoc/index.html | 2 +- dev/containers/CCListLabels/Infix/index.html | 2 +- dev/containers/CCListLabels/Ref/index.html | 2 +- dev/containers/CCListLabels/Traverse/argument-1-M/index.html | 2 +- dev/containers/CCListLabels/Traverse/index.html | 2 +- dev/containers/CCListLabels/index.html | 2 +- dev/containers/CCListLabels/module-type-MONAD/index.html | 2 +- dev/containers/CCMap/Make/index.html | 2 +- dev/containers/CCMap/index.html | 2 +- dev/containers/CCMap/module-type-S/index.html | 2 +- dev/containers/CCMonomorphic/index.html | 2 +- dev/containers/CCNativeint/Infix/index.html | 2 +- dev/containers/CCNativeint/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/CCOrd/Infix/index.html | 2 +- dev/containers/CCOrd/index.html | 2 +- dev/containers/CCPair/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 | 2 +- dev/containers/CCParse/index.html | 2 +- dev/containers/CCRandom/index.html | 2 +- dev/containers/CCRef/index.html | 2 +- dev/containers/CCResult/Infix/index.html | 2 +- dev/containers/CCResult/Traverse/argument-1-M/index.html | 2 +- dev/containers/CCResult/Traverse/index.html | 2 +- dev/containers/CCResult/index.html | 2 +- dev/containers/CCResult/module-type-MONAD/index.html | 2 +- dev/containers/CCSeq/Infix/index.html | 2 +- dev/containers/CCSeq/Traverse/argument-1-M/index.html | 2 +- dev/containers/CCSeq/Traverse/index.html | 2 +- dev/containers/CCSeq/index.html | 2 +- dev/containers/CCSeq/module-type-MONAD/index.html | 2 +- dev/containers/CCSet/Make/index.html | 2 +- dev/containers/CCSet/index.html | 2 +- dev/containers/CCSet/module-type-S/index.html | 2 +- dev/containers/CCSexp/Decoder/index.html | 2 +- dev/containers/CCSexp/Make/Decoder/index.html | 2 +- dev/containers/CCSexp/Make/argument-1-Sexp/index.html | 2 +- dev/containers/CCSexp/Make/index.html | 2 +- dev/containers/CCSexp/index.html | 2 +- dev/containers/CCSexp_intf/index.html | 2 +- dev/containers/CCSexp_intf/module-type-BASIC_SEXP/index.html | 2 +- dev/containers/CCSexp_intf/module-type-S/Decoder/index.html | 2 +- dev/containers/CCSexp_intf/module-type-S/index.html | 2 +- dev/containers/CCSexp_intf/module-type-S0/index.html | 2 +- dev/containers/CCSexp_intf/module-type-SEXP/index.html | 2 +- dev/containers/CCSexp_lex/index.html | 2 +- dev/containers/CCShims_/index.html | 2 +- dev/containers/CCShims_syntax/index.html | 2 +- dev/containers/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 | 2 +- dev/containers/CCString/index.html | 2 +- dev/containers/CCStringLabels/Find/index.html | 2 +- dev/containers/CCStringLabels/Infix/index.html | 2 +- dev/containers/CCStringLabels/Split/index.html | 2 +- dev/containers/CCStringLabels/index.html | 2 +- dev/containers/CCUnit/index.html | 2 +- dev/containers/CCUnix/Infix/index.html | 2 +- dev/containers/CCUnix/index.html | 2 +- dev/containers/CCUtf8_string/index.html | 2 +- dev/containers/CCVector/index.html | 2 +- dev/containers/Containers/Hashtbl/Make/index.html | 2 +- dev/containers/Containers/Hashtbl/MakeSeeded/index.html | 2 +- dev/containers/Containers/Hashtbl/index.html | 2 +- .../Containers/Hashtbl/module-type-HashedType/index.html | 2 +- dev/containers/Containers/Hashtbl/module-type-S/index.html | 2 +- .../Containers/Hashtbl/module-type-SeededHashedType/index.html | 2 +- .../Containers/Hashtbl/module-type-SeededS/index.html | 2 +- dev/containers/Containers/index.html | 2 +- dev/containers/ContainersLabels/Hashtbl/Make/index.html | 2 +- dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html | 2 +- dev/containers/ContainersLabels/Hashtbl/index.html | 2 +- .../ContainersLabels/Hashtbl/module-type-HashedType/index.html | 2 +- .../ContainersLabels/Hashtbl/module-type-S/index.html | 2 +- .../Hashtbl/module-type-SeededHashedType/index.html | 2 +- .../ContainersLabels/Hashtbl/module-type-SeededS/index.html | 2 +- dev/containers/ContainersLabels/index.html | 2 +- dev/containers/Containers_bencode/Decode/index.html | 2 +- dev/containers/Containers_bencode/Encode/index.html | 2 +- dev/containers/Containers_bencode/Str_map/index.html | 2 +- dev/containers/Containers_bencode/index.html | 2 +- dev/containers/Containers_cbor/index.html | 2 +- dev/containers/Containers_codegen/Bitfield/index.html | 2 +- dev/containers/Containers_codegen/Code/index.html | 2 +- dev/containers/Containers_codegen/index.html | 2 +- dev/containers/Containers_top/index.html | 2 +- dev/containers/index.html | 2 +- dev/odoc.css | 2 +- 288 files changed, 289 insertions(+), 288 deletions(-) diff --git a/dev/containers-data/CCBV/index.html b/dev/containers-data/CCBV/index.html index 7f384095..b669893c 100644 --- a/dev/containers-data/CCBV/index.html +++ b/dev/containers-data/CCBV/index.html @@ -1,2 +1,3 @@ -CCBV (containers-data.CCBV)

Module CCBV

Imperative Bitvectors

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.

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

Create a bitvector of given size, with given default value.

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 or shrink the underlying bitvector.

  • raises Invalid_arg

    on negative sizes.

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 flip : t -> int -> unit

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

val clear : t -> unit

Set every bit to 0.

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.

val negate_self : t -> unit

negate_self t flips all of the bits in t.

  • since 1.2
val negate : t -> t

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

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.

val union : t -> t -> t

union bv1 bv2 returns the union of the two sets.

val inter : t -> t -> t

inter bv1 bv2 returns the intersection of the two sets.

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
val of_iter : int iter -> t
val pp : Stdlib.Format.formatter -> t -> unit

Print the bitvector as a string of bits.

  • since 0.13
\ No newline at end of file +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 NEXT_RELEASE
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 NEXT_RELEASE
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 NEXT_RELEASE
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 NEXT_RELEASE
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/CCBijection/Make/argument-1-L/index.html b/dev/containers-data/CCBijection/Make/argument-1-L/index.html index fba2a2b4..f52229b6 100644 --- a/dev/containers-data/CCBijection/Make/argument-1-L/index.html +++ b/dev/containers-data/CCBijection/Make/argument-1-L/index.html @@ -1,2 +1,2 @@ -L (containers-data.CCBijection.Make.1-L)

Parameter Make.1-L

type t
val compare : t -> t -> int
\ No newline at end of file +L (containers-data.CCBijection.Make.1-L)

Parameter Make.1-L

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCBijection/Make/argument-2-R/index.html b/dev/containers-data/CCBijection/Make/argument-2-R/index.html index 0df51b4c..52ab9c85 100644 --- a/dev/containers-data/CCBijection/Make/argument-2-R/index.html +++ b/dev/containers-data/CCBijection/Make/argument-2-R/index.html @@ -1,2 +1,2 @@ -R (containers-data.CCBijection.Make.2-R)

Parameter Make.2-R

type t
val compare : t -> t -> int
\ No newline at end of file +R (containers-data.CCBijection.Make.2-R)

Parameter Make.2-R

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCBijection/Make/index.html b/dev/containers-data/CCBijection/Make/index.html index cc16c71b..0a12d184 100644 --- a/dev/containers-data/CCBijection/Make/index.html +++ b/dev/containers-data/CCBijection/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCBijection.Make)

Module CCBijection.Make

Parameters

module L : OrderedType
module R : OrderedType

Signature

type t
type left = L.t
type right = R.t
val empty : t
val is_empty : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val add : left -> right -> t -> t

Add left and right correspondence to bijection such that left and right are unique in their respective sets and only correspond to each other.

val cardinal : t -> int

Number of bindings. O(n) time.

val mem : left -> right -> t -> bool

Check both sides for key membership.

val mem_left : left -> t -> bool

Check for membership of correspondence using left key.

val mem_right : right -> t -> bool

Check for membership of correspondence using right key.

val find_left : left -> t -> right
  • raises Not_found

    if left is not found.

val find_right : right -> t -> left
  • raises Not_found

    if right is not found.

val remove : left -> right -> t -> t

Remove the left, right binding if it exists. Return the same bijection otherwise.

val remove_left : left -> t -> t

Remove the binding with left key if it exists. Return the same bijection otherwise.

val remove_right : right -> t -> t

Remove the binding with right key if it exists. Return the same bijection otherwise.

val list_left : t -> (left * right) list

Return the bindings as a list of (left, right) values.

val list_right : t -> (right * left) list

Return the bindings as a list of (right, left) values.

val add_iter : (left * right) iter -> t -> t
val of_iter : (left * right) iter -> t
val to_iter : t -> (left * right) iter
val add_list : (left * right) list -> t -> t
val of_list : (left * right) list -> t
val to_list : t -> (left * right) list
\ No newline at end of file +Make (containers-data.CCBijection.Make)

Module CCBijection.Make

Parameters

module L : OrderedType
module R : OrderedType

Signature

type t
type left = L.t
type right = R.t
val empty : t
val is_empty : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val add : left -> right -> t -> t

Add left and right correspondence to bijection such that left and right are unique in their respective sets and only correspond to each other.

val cardinal : t -> int

Number of bindings. O(n) time.

val mem : left -> right -> t -> bool

Check both sides for key membership.

val mem_left : left -> t -> bool

Check for membership of correspondence using left key.

val mem_right : right -> t -> bool

Check for membership of correspondence using right key.

val find_left : left -> t -> right
  • raises Not_found

    if left is not found.

val find_right : right -> t -> left
  • raises Not_found

    if right is not found.

val remove : left -> right -> t -> t

Remove the left, right binding if it exists. Return the same bijection otherwise.

val remove_left : left -> t -> t

Remove the binding with left key if it exists. Return the same bijection otherwise.

val remove_right : right -> t -> t

Remove the binding with right key if it exists. Return the same bijection otherwise.

val list_left : t -> (left * right) list

Return the bindings as a list of (left, right) values.

val list_right : t -> (right * left) list

Return the bindings as a list of (right, left) values.

val add_iter : (left * right) iter -> t -> t
val of_iter : (left * right) iter -> t
val to_iter : t -> (left * right) iter
val add_list : (left * right) list -> t -> t
val of_list : (left * right) list -> t
val to_list : t -> (left * right) list
\ No newline at end of file diff --git a/dev/containers-data/CCBijection/index.html b/dev/containers-data/CCBijection/index.html index dad5a1e8..8cfefacc 100644 --- a/dev/containers-data/CCBijection/index.html +++ b/dev/containers-data/CCBijection/index.html @@ -1,5 +1,5 @@ -CCBijection (containers-data.CCBijection)

Module CCBijection

Functor to build a bijection Represents 1-to-1 mappings between two types. Each element from the "left" is mapped to one "right" value, and conversely.

type 'a iter = ( 'a -> unit ) -> unit
module type OrderedType = sig ... end
module type S = sig ... end
module Make +CCBijection (containers-data.CCBijection)

Module CCBijection

Functor to build a bijection Represents 1-to-1 mappings between two types. Each element from the "left" is mapped to one "right" value, and conversely.

  • since 2.1
type 'a iter = ( 'a -> unit ) -> unit
module type OrderedType = sig ... end
module type S = sig ... end
module Make (L : OrderedType) (R : OrderedType) : S with type left = L.t and type right = R.t
\ No newline at end of file diff --git a/dev/containers-data/CCBijection/module-type-OrderedType/index.html b/dev/containers-data/CCBijection/module-type-OrderedType/index.html index 8376112f..9bcd05d1 100644 --- a/dev/containers-data/CCBijection/module-type-OrderedType/index.html +++ b/dev/containers-data/CCBijection/module-type-OrderedType/index.html @@ -1,2 +1,2 @@ -OrderedType (containers-data.CCBijection.OrderedType)

Module type CCBijection.OrderedType

type t
val compare : t -> t -> int
\ No newline at end of file +OrderedType (containers-data.CCBijection.OrderedType)

Module type CCBijection.OrderedType

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCBijection/module-type-S/index.html b/dev/containers-data/CCBijection/module-type-S/index.html index e310edc3..e2ac598c 100644 --- a/dev/containers-data/CCBijection/module-type-S/index.html +++ b/dev/containers-data/CCBijection/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCBijection.S)

Module type CCBijection.S

type t
type left
type right
val empty : t
val is_empty : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val add : left -> right -> t -> t

Add left and right correspondence to bijection such that left and right are unique in their respective sets and only correspond to each other.

val cardinal : t -> int

Number of bindings. O(n) time.

val mem : left -> right -> t -> bool

Check both sides for key membership.

val mem_left : left -> t -> bool

Check for membership of correspondence using left key.

val mem_right : right -> t -> bool

Check for membership of correspondence using right key.

val find_left : left -> t -> right
  • raises Not_found

    if left is not found.

val find_right : right -> t -> left
  • raises Not_found

    if right is not found.

val remove : left -> right -> t -> t

Remove the left, right binding if it exists. Return the same bijection otherwise.

val remove_left : left -> t -> t

Remove the binding with left key if it exists. Return the same bijection otherwise.

val remove_right : right -> t -> t

Remove the binding with right key if it exists. Return the same bijection otherwise.

val list_left : t -> (left * right) list

Return the bindings as a list of (left, right) values.

val list_right : t -> (right * left) list

Return the bindings as a list of (right, left) values.

val add_iter : (left * right) iter -> t -> t
val of_iter : (left * right) iter -> t
val to_iter : t -> (left * right) iter
val add_list : (left * right) list -> t -> t
val of_list : (left * right) list -> t
val to_list : t -> (left * right) list
\ No newline at end of file +S (containers-data.CCBijection.S)

Module type CCBijection.S

type t
type left
type right
val empty : t
val is_empty : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val add : left -> right -> t -> t

Add left and right correspondence to bijection such that left and right are unique in their respective sets and only correspond to each other.

val cardinal : t -> int

Number of bindings. O(n) time.

val mem : left -> right -> t -> bool

Check both sides for key membership.

val mem_left : left -> t -> bool

Check for membership of correspondence using left key.

val mem_right : right -> t -> bool

Check for membership of correspondence using right key.

val find_left : left -> t -> right
  • raises Not_found

    if left is not found.

val find_right : right -> t -> left
  • raises Not_found

    if right is not found.

val remove : left -> right -> t -> t

Remove the left, right binding if it exists. Return the same bijection otherwise.

val remove_left : left -> t -> t

Remove the binding with left key if it exists. Return the same bijection otherwise.

val remove_right : right -> t -> t

Remove the binding with right key if it exists. Return the same bijection otherwise.

val list_left : t -> (left * right) list

Return the bindings as a list of (left, right) values.

val list_right : t -> (right * left) list

Return the bindings as a list of (right, left) values.

val add_iter : (left * right) iter -> t -> t
val of_iter : (left * right) iter -> t
val to_iter : t -> (left * right) iter
val add_list : (left * right) list -> t -> t
val of_list : (left * right) list -> t
val to_list : t -> (left * right) list
\ No newline at end of file diff --git a/dev/containers-data/CCBitField/Make/argument-1-_/index.html b/dev/containers-data/CCBitField/Make/argument-1-_/index.html index 81bc9934..29dc27e5 100644 --- a/dev/containers-data/CCBitField/Make/argument-1-_/index.html +++ b/dev/containers-data/CCBitField/Make/argument-1-_/index.html @@ -1,2 +1,2 @@ -_ (containers-data.CCBitField.Make.1-_)

Parameter Make.1-_

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

Parameter Make.1-_

\ No newline at end of file diff --git a/dev/containers-data/CCBitField/Make/index.html b/dev/containers-data/CCBitField/Make/index.html index 194ea0ef..8ba4e812 100644 --- a/dev/containers-data/CCBitField/Make/index.html +++ b/dev/containers-data/CCBitField/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCBitField.Make)

Module CCBitField.Make

Create a new bitfield type

Parameters

module _ : sig ... end

Signature

type t = private int

Generative type of bitfields. Each instantiation of the functor should create a new, incompatible type

val empty : t

Empty bitfields (all bits 0).

type field
val get : field -> t -> bool

Get the value of this field.

val set : field -> bool -> t -> t

Set the value of this field.

val mk_field : unit -> field

Make a new field.

val freeze : unit -> unit

Prevent new fields from being added. From now on, creating a field will raise Frozen.

val total_width : unit -> int

Current width of the bitfield.

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

Module CCBitField.Make

Create a new bitfield type

Parameters

module _ : sig ... end

Signature

type t = private int

Generative type of bitfields. Each instantiation of the functor should create a new, incompatible type

val empty : t

Empty bitfields (all bits 0).

type field
val get : field -> t -> bool

Get the value of this field.

val set : field -> bool -> t -> t

Set the value of this field.

val mk_field : unit -> field

Make a new field.

val freeze : unit -> unit

Prevent new fields from being added. From now on, creating a field will raise Frozen.

val total_width : unit -> int

Current width of the bitfield.

\ No newline at end of file diff --git a/dev/containers-data/CCBitField/index.html b/dev/containers-data/CCBitField/index.html index 40e56596..eb1d1cf3 100644 --- a/dev/containers-data/CCBitField/index.html +++ b/dev/containers-data/CCBitField/index.html @@ -1,5 +1,5 @@ -CCBitField (containers-data.CCBitField)

Module CCBitField

Efficient Bit Field for up to 31 or 61 fiels

This module defines efficient bitfields up to 31 or 61 bits (depending on the architecture) in a relatively type-safe way.

module B = CCBitField.Make(struct end);;
+CCBitField (containers-data.CCBitField)

Module CCBitField

Efficient Bit Field for up to 31 or 61 fiels

This module defines efficient bitfields up to 31 or 61 bits (depending on the architecture) in a relatively type-safe way.

module B = CCBitField.Make(struct end);;
 
 let x = B.mk_field ()
 let y = B.mk_field ()
diff --git a/dev/containers-data/CCBitField/module-type-S/index.html b/dev/containers-data/CCBitField/module-type-S/index.html
index 97f28302..f8547102 100644
--- a/dev/containers-data/CCBitField/module-type-S/index.html
+++ b/dev/containers-data/CCBitField/module-type-S/index.html
@@ -1,2 +1,2 @@
 
-S (containers-data.CCBitField.S)

Module type CCBitField.S

Bitfield Signature

type t = private int

Generative type of bitfields. Each instantiation of the functor should create a new, incompatible type

val empty : t

Empty bitfields (all bits 0).

type field
val get : field -> t -> bool

Get the value of this field.

val set : field -> bool -> t -> t

Set the value of this field.

val mk_field : unit -> field

Make a new field.

val freeze : unit -> unit

Prevent new fields from being added. From now on, creating a field will raise Frozen.

val total_width : unit -> int

Current width of the bitfield.

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

Module type CCBitField.S

Bitfield Signature

type t = private int

Generative type of bitfields. Each instantiation of the functor should create a new, incompatible type

val empty : t

Empty bitfields (all bits 0).

type field
val get : field -> t -> bool

Get the value of this field.

val set : field -> bool -> t -> t

Set the value of this field.

val mk_field : unit -> field

Make a new field.

val freeze : unit -> unit

Prevent new fields from being added. From now on, creating a field will raise Frozen.

val total_width : unit -> int

Current width of the bitfield.

\ No newline at end of file diff --git a/dev/containers-data/CCCache/index.html b/dev/containers-data/CCCache/index.html index ef966acf..9cf1d05a 100644 --- a/dev/containers-data/CCCache/index.html +++ b/dev/containers-data/CCCache/index.html @@ -1,5 +1,5 @@ -CCCache (containers-data.CCCache)

Module CCCache

Caches Utils

Particularly useful for memoization. See with_cache and with_cache_rec for more details.

  • since 0.6
type 'a equal = 'a -> 'a -> bool
type 'a hash = 'a -> int

Value interface

Typical use case: one wants to memoize a function f : 'a -> 'b. Code sample:

let f x =
+CCCache (containers-data.CCCache)

Module CCCache

Caches Utils

Particularly useful for memoization. See with_cache and with_cache_rec for more details.

  • since 0.6
type 'a equal = 'a -> 'a -> bool
type 'a hash = 'a -> int

Value interface

Typical use case: one wants to memoize a function f : 'a -> 'b. Code sample:

let f x =
   print_endline "call f";
   x + 1;;
 
diff --git a/dev/containers-data/CCDeque/index.html b/dev/containers-data/CCDeque/index.html
index ec31a56a..47d5f7f3 100644
--- a/dev/containers-data/CCDeque/index.html
+++ b/dev/containers-data/CCDeque/index.html
@@ -1,2 +1,2 @@
 
-CCDeque (containers-data.CCDeque)

Module CCDeque

Imperative deque

This structure provides fast access to its front and back elements, with O(1) operations.

type 'a t

Contains 'a elements, queue in both ways

exception Empty
val create : unit -> 'a t

New deque.

val clear : _ t -> unit

Remove all elements.

  • since 0.13
val is_empty : 'a t -> bool

Is the deque empty?

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

equal a b checks whether a and b contain the same sequence of elements.

  • parameter eq

    comparison function for elements.

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

compare a b compares lexicographically a and b.

  • parameter cmp

    comparison function for elements.

  • since 0.13
val length : 'a t -> int

Number of elements. Used to be linear time, now constant time.

val push_front : 'a t -> 'a -> unit

Push value at the front.

val push_back : 'a t -> 'a -> unit

Push value at the back.

val peek_front : 'a t -> 'a

First value.

  • raises Empty

    if empty.

val peek_front_opt : 'a t -> 'a option

First value.

  • since 2.7
val peek_back : 'a t -> 'a

Last value.

  • raises Empty

    if empty.

val peek_back_opt : 'a t -> 'a option

Last value.

  • since 2.7
val remove_back : 'a t -> unit

Remove last value. If the deque is empty do nothing

  • since 2.7
val remove_front : 'a t -> unit

Remove first value. If the deque is empty do nothing

  • since 2.7
val take_back : 'a t -> 'a

Take last value.

  • raises Empty

    if empty.

val take_back_opt : 'a t -> 'a option

Take last value.

  • since 2.7
val take_front : 'a t -> 'a

Take first value.

  • raises Empty

    if empty.

val take_front_opt : 'a t -> 'a option

Take first value.

  • since 2.7
val update_back : 'a t -> ( 'a -> 'a option ) -> unit

Update last value. If the deque is empty do nothing. If the function returns None, remove last element; if it returns Some x, replace last element with x.

  • since 2.7
val update_front : 'a t -> ( 'a -> 'a option ) -> unit

Update first value. If the deque is empty do nothing. Similar to update_back but for the first value.

  • since 2.7
val append_front : into:'a t -> 'a t -> unit

append_front ~into q adds all elements of q at the front of into. O(length q) in time.

  • since 0.13
val append_back : into:'a t -> 'a t -> unit

append_back ~into q adds all elements of q at the back of into. O(length q) in time.

  • since 0.13
val iter : ( 'a -> unit ) -> 'a t -> unit

Iterate on elements.

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

Fold on elements.

  • since 0.13

Conversions

type 'a gen = unit -> 'a option
type 'a iter = ( 'a -> unit ) -> unit
val of_iter : 'a iter -> 'a t

Create a deque from the sequence. Optional argument deque disappears, use add_iter_back instead.

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

Iterate on the elements.

val of_gen : 'a gen -> 'a t

of_gen g makes a deque containing the elements of g.

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

Iterate on the elements of the deque.

  • since 0.13
val add_iter_front : 'a t -> 'a iter -> unit

add_iter_front q seq adds elements of seq into the front of q, in reverse order. O(n) in time, where n is the number of elements to add.

  • since 0.13
val add_iter_back : 'a t -> 'a iter -> unit

add_iter_back q seq adds elements of seq into the back of q, in order. O(n) in time, where n is the number of elements to add.

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

Fresh copy, O(n) in time.

val of_list : 'a list -> 'a t

Conversion from list, in order.

  • since 0.13
val to_list : 'a t -> 'a list

List of elements, in order. Less efficient than to_rev_list.

  • since 0.13
val to_rev_list : 'a t -> 'a list

Efficient conversion to list, in reverse order.

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

Filter into a new copy.

  • since 2.7
val filter_map : ( 'a -> 'b option ) -> 'a t -> 'b t

Filter map into a new copy

  • since 2.7
val filter_in_place : 'a t -> ( 'a -> bool ) -> unit

Keep only elements that satisfy the predicate.

  • since 2.7

print

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : 'a printer -> 'a t printer

Print the elements.

  • since 0.13
\ No newline at end of file +CCDeque (containers-data.CCDeque)

Module CCDeque

Imperative deque

This structure provides fast access to its front and back elements, with O(1) operations.

type 'a t

Contains 'a elements, queue in both ways

exception Empty
val create : unit -> 'a t

New deque.

val clear : _ t -> unit

Remove all elements.

  • since 0.13
val is_empty : 'a t -> bool

Is the deque empty?

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

equal a b checks whether a and b contain the same sequence of elements.

  • parameter eq

    comparison function for elements.

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

compare a b compares lexicographically a and b.

  • parameter cmp

    comparison function for elements.

  • since 0.13
val length : 'a t -> int

Number of elements. Used to be linear time, now constant time.

val push_front : 'a t -> 'a -> unit

Push value at the front.

val push_back : 'a t -> 'a -> unit

Push value at the back.

val peek_front : 'a t -> 'a

First value.

  • raises Empty

    if empty.

val peek_front_opt : 'a t -> 'a option

First value.

  • since 2.7
val peek_back : 'a t -> 'a

Last value.

  • raises Empty

    if empty.

val peek_back_opt : 'a t -> 'a option

Last value.

  • since 2.7
val remove_back : 'a t -> unit

Remove last value. If the deque is empty do nothing

  • since 2.7
val remove_front : 'a t -> unit

Remove first value. If the deque is empty do nothing

  • since 2.7
val take_back : 'a t -> 'a

Take last value.

  • raises Empty

    if empty.

val take_back_opt : 'a t -> 'a option

Take last value.

  • since 2.7
val take_front : 'a t -> 'a

Take first value.

  • raises Empty

    if empty.

val take_front_opt : 'a t -> 'a option

Take first value.

  • since 2.7
val update_back : 'a t -> ( 'a -> 'a option ) -> unit

Update last value. If the deque is empty do nothing. If the function returns None, remove last element; if it returns Some x, replace last element with x.

  • since 2.7
val update_front : 'a t -> ( 'a -> 'a option ) -> unit

Update first value. If the deque is empty do nothing. Similar to update_back but for the first value.

  • since 2.7
val append_front : into:'a t -> 'a t -> unit

append_front ~into q adds all elements of q at the front of into. O(length q) in time.

  • since 0.13
val append_back : into:'a t -> 'a t -> unit

append_back ~into q adds all elements of q at the back of into. O(length q) in time.

  • since 0.13
val iter : ( 'a -> unit ) -> 'a t -> unit

Iterate on elements.

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

Fold on elements.

  • since 0.13

Conversions

type 'a gen = unit -> 'a option
type 'a iter = ( 'a -> unit ) -> unit
val of_iter : 'a iter -> 'a t

Create a deque from the sequence. Optional argument deque disappears, use add_iter_back instead.

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

Iterate on the elements.

val of_gen : 'a gen -> 'a t

of_gen g makes a deque containing the elements of g.

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

Iterate on the elements of the deque.

  • since 0.13
val add_iter_front : 'a t -> 'a iter -> unit

add_iter_front q seq adds elements of seq into the front of q, in reverse order. O(n) in time, where n is the number of elements to add.

  • since 0.13
val add_iter_back : 'a t -> 'a iter -> unit

add_iter_back q seq adds elements of seq into the back of q, in order. O(n) in time, where n is the number of elements to add.

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

Fresh copy, O(n) in time.

val of_list : 'a list -> 'a t

Conversion from list, in order.

  • since 0.13
val to_list : 'a t -> 'a list

List of elements, in order. Less efficient than to_rev_list.

  • since 0.13
val to_rev_list : 'a t -> 'a list

Efficient conversion to list, in reverse order.

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

Filter into a new copy.

  • since 2.7
val filter_map : ( 'a -> 'b option ) -> 'a t -> 'b t

Filter map into a new copy

  • since 2.7
val filter_in_place : 'a t -> ( 'a -> bool ) -> unit

Keep only elements that satisfy the predicate.

  • since 2.7

print

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : 'a printer -> 'a t printer

Print the elements.

  • since 0.13
\ No newline at end of file diff --git a/dev/containers-data/CCFQueue/index.html b/dev/containers-data/CCFQueue/index.html index 071bb5f3..83526369 100644 --- a/dev/containers-data/CCFQueue/index.html +++ b/dev/containers-data/CCFQueue/index.html @@ -1,2 +1,2 @@ -CCFQueue (containers-data.CCFQueue)

Module CCFQueue

Functional queues

type 'a iter = ( 'a -> unit ) -> unit
type 'a equal = 'a -> 'a -> bool
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type +'a t

Queue containing elements of type 'a

val empty : 'a t
val is_empty : 'a t -> bool
val singleton : 'a -> 'a t
val doubleton : 'a -> 'a -> 'a t
exception Empty
val cons : 'a -> 'a t -> 'a t

Push element at the front of the queue.

val snoc : 'a t -> 'a -> 'a t

Push element at the end of the queue.

val take_front : 'a t -> ('a * 'a t) option

Get and remove the first element.

val take_front_exn : 'a t -> 'a * 'a t

Same as take_front, but fails on empty queues.

  • raises Empty

    if the queue is empty.

val take_front_l : int -> 'a t -> 'a list * 'a t

take_front_l n q takes at most n elements from the front of q, and returns them wrapped in a list.

  • raises Invalid_argument

    if n<0.

val take_front_while : ( 'a -> bool ) -> 'a t -> 'a list * 'a t
val take_back : 'a t -> ('a t * 'a) option

Take last element.

val take_back_exn : 'a t -> 'a t * 'a

Same as take_back, but fails on empty queues.

  • raises Empty

    if the queue is empty.

val take_back_l : int -> 'a t -> 'a t * 'a list

take_back_l n q removes and returns the last n elements of q. The elements are in the order of the queue, that is, the head of the returned list is the first element to appear via take_front. take_back_l 2 (of_list [1;2;3;4]) = of_list [1;2], [3;4].

  • raises Invalid_argument

    if n<0.

val take_back_while : ( 'a -> bool ) -> 'a t -> 'a t * 'a list

Individual extraction

val first : 'a t -> 'a option

First element of the queue.

val last : 'a t -> 'a option

Last element of the queue.

val first_exn : 'a t -> 'a

Same as first but

  • raises Empty

    if the queue is empty.

val last_exn : 'a t -> 'a
val nth : int -> 'a t -> 'a option

Return the i-th element of the queue in logarithmic time.

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

Unsafe version of nth.

  • raises Not_found

    if the index is wrong.

val tail : 'a t -> 'a t

Queue deprived of its first element. Does nothing on empty queues.

val init : 'a t -> 'a t

Queue deprived of its last element. Does nothing on empty queues.

Global Operations

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

Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.

val rev : 'a t -> 'a t

Reverse the queue, O(n) complexity.

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

Map values.

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

Synonym to map.

val size : 'a t -> int

Number of elements in the queue (constant time).

val fold : ( 'b -> 'a -> 'b ) -> 'b -> 'a t -> 'b
val iter : ( 'a -> unit ) -> 'a t -> unit
val equal : 'a equal -> 'a t equal

Conversions

val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list
val add_iter_front : 'a iter -> 'a t -> 'a t
  • since 3.0
val add_iter_back : 'a t -> 'a iter -> 'a t
  • since 3.0
val to_iter : 'a t -> 'a iter
  • since 3.0
val of_iter : 'a iter -> 'a t
  • since 3.0
val add_seq_front : 'a Stdlib.Seq.t -> 'a t -> 'a t
  • since 3.0
val add_seq_back : 'a t -> 'a Stdlib.Seq.t -> 'a t
  • since 3.0
val to_seq : 'a t -> 'a Stdlib.Seq.t
  • since 3.0
val of_seq : 'a Stdlib.Seq.t -> 'a t
  • since 3.0
val (--) : int -> int -> int t

a -- b is the integer range from a to b, both included.

  • since 0.10
val (--^) : int -> int -> int t

a -- b is the integer range from a to b, where b is excluded.

  • since 0.17
val pp : 'a printer -> 'a t printer
  • since 0.13
\ No newline at end of file +CCFQueue (containers-data.CCFQueue)

Module CCFQueue

Functional queues

type 'a iter = ( 'a -> unit ) -> unit
type 'a equal = 'a -> 'a -> bool
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type +'a t

Queue containing elements of type 'a

val empty : 'a t
val is_empty : 'a t -> bool
val singleton : 'a -> 'a t
val doubleton : 'a -> 'a -> 'a t
exception Empty
val cons : 'a -> 'a t -> 'a t

Push element at the front of the queue.

val snoc : 'a t -> 'a -> 'a t

Push element at the end of the queue.

val take_front : 'a t -> ('a * 'a t) option

Get and remove the first element.

val take_front_exn : 'a t -> 'a * 'a t

Same as take_front, but fails on empty queues.

  • raises Empty

    if the queue is empty.

val take_front_l : int -> 'a t -> 'a list * 'a t

take_front_l n q takes at most n elements from the front of q, and returns them wrapped in a list.

  • raises Invalid_argument

    if n<0.

val take_front_while : ( 'a -> bool ) -> 'a t -> 'a list * 'a t
val take_back : 'a t -> ('a t * 'a) option

Take last element.

val take_back_exn : 'a t -> 'a t * 'a

Same as take_back, but fails on empty queues.

  • raises Empty

    if the queue is empty.

val take_back_l : int -> 'a t -> 'a t * 'a list

take_back_l n q removes and returns the last n elements of q. The elements are in the order of the queue, that is, the head of the returned list is the first element to appear via take_front. take_back_l 2 (of_list [1;2;3;4]) = of_list [1;2], [3;4].

  • raises Invalid_argument

    if n<0.

val take_back_while : ( 'a -> bool ) -> 'a t -> 'a t * 'a list

Individual extraction

val first : 'a t -> 'a option

First element of the queue.

val last : 'a t -> 'a option

Last element of the queue.

val first_exn : 'a t -> 'a

Same as first but

  • raises Empty

    if the queue is empty.

val last_exn : 'a t -> 'a
val nth : int -> 'a t -> 'a option

Return the i-th element of the queue in logarithmic time.

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

Unsafe version of nth.

  • raises Not_found

    if the index is wrong.

val tail : 'a t -> 'a t

Queue deprived of its first element. Does nothing on empty queues.

val init : 'a t -> 'a t

Queue deprived of its last element. Does nothing on empty queues.

Global Operations

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

Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.

val rev : 'a t -> 'a t

Reverse the queue, O(n) complexity.

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

Map values.

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

Synonym to map.

val size : 'a t -> int

Number of elements in the queue (constant time).

val fold : ( 'b -> 'a -> 'b ) -> 'b -> 'a t -> 'b
val iter : ( 'a -> unit ) -> 'a t -> unit
val equal : 'a equal -> 'a t equal

Conversions

val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list
val add_iter_front : 'a iter -> 'a t -> 'a t
  • since 3.0
val add_iter_back : 'a t -> 'a iter -> 'a t
  • since 3.0
val to_iter : 'a t -> 'a iter
  • since 3.0
val of_iter : 'a iter -> 'a t
  • since 3.0
val add_seq_front : 'a Stdlib.Seq.t -> 'a t -> 'a t
  • since 3.0
val add_seq_back : 'a t -> 'a Stdlib.Seq.t -> 'a t
  • since 3.0
val to_seq : 'a t -> 'a Stdlib.Seq.t
  • since 3.0
val of_seq : 'a Stdlib.Seq.t -> 'a t
  • since 3.0
val (--) : int -> int -> int t

a -- b is the integer range from a to b, both included.

  • since 0.10
val (--^) : int -> int -> int t

a -- b is the integer range from a to b, where b is excluded.

  • since 0.17
val pp : 'a printer -> 'a t printer
  • since 0.13
\ No newline at end of file diff --git a/dev/containers-data/CCFun_vec/index.html b/dev/containers-data/CCFun_vec/index.html index 3a80b298..ec8e7bd0 100644 --- a/dev/containers-data/CCFun_vec/index.html +++ b/dev/containers-data/CCFun_vec/index.html @@ -1,2 +1,2 @@ -CCFun_vec (containers-data.CCFun_vec)

Module CCFun_vec

Functional Vectors

Tree with a large branching factor for logarithmic operations with a low multiplicative factor.

status: experimental. DO NOT USE (yet)

  • since 2.1
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]

Signature

type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val return : 'a -> 'a t
val length : _ t -> int
val push : 'a -> 'a t -> 'a t

Add element at the end.

val get : int -> 'a t -> 'a option
val get_exn : int -> 'a t -> 'a
  • raises Not_found

    if key not present.

val pop_exn : 'a t -> 'a * 'a t

Pop last element.

val pop : 'a t -> ('a * 'a t) option

Pop last element.

  • since 2.5
val iter : f:( 'a -> unit ) -> 'a t -> unit
val iteri : f:( int -> 'a -> unit ) -> 'a t -> unit

Iterate on elements with their index, in increasing order.

val iteri_rev : f:( int -> 'a -> unit ) -> 'a t -> unit

Iterate on elements with their index, but starting from the end.

val fold : f:( 'b -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val foldi : f:( 'b -> int -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val append : 'a t -> 'a t -> 'a t
val map : ( 'a -> 'b ) -> 'a t -> 'b t
val choose : 'a t -> 'a option
Conversions
val to_list : 'a t -> 'a list
val of_list : 'a list -> 'a t
val add_list : 'a t -> 'a list -> 'a t
val add_iter : 'a t -> 'a iter -> 'a t
val of_iter : 'a iter -> 'a t
val to_iter : 'a t -> 'a iter
val add_gen : 'a t -> 'a gen -> 'a t
val of_gen : 'a gen -> 'a t
val to_gen : 'a t -> 'a gen
IO
val pp : 'a printer -> 'a t printer
\ No newline at end of file +CCFun_vec (containers-data.CCFun_vec)

Module CCFun_vec

Functional Vectors

Tree with a large branching factor for logarithmic operations with a low multiplicative factor.

status: experimental. DO NOT USE (yet)

  • since 2.1
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]

Signature

type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val return : 'a -> 'a t
val length : _ t -> int
val push : 'a -> 'a t -> 'a t

Add element at the end.

val get : int -> 'a t -> 'a option
val get_exn : int -> 'a t -> 'a
  • raises Not_found

    if key not present.

val pop_exn : 'a t -> 'a * 'a t

Pop last element.

val pop : 'a t -> ('a * 'a t) option

Pop last element.

  • since 2.5
val iter : f:( 'a -> unit ) -> 'a t -> unit
val iteri : f:( int -> 'a -> unit ) -> 'a t -> unit

Iterate on elements with their index, in increasing order.

val iteri_rev : f:( int -> 'a -> unit ) -> 'a t -> unit

Iterate on elements with their index, but starting from the end.

val fold : f:( 'b -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val foldi : f:( 'b -> int -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val append : 'a t -> 'a t -> 'a t
val map : ( 'a -> 'b ) -> 'a t -> 'b t
val choose : 'a t -> 'a option
Conversions
val to_list : 'a t -> 'a list
val of_list : 'a list -> 'a t
val add_list : 'a t -> 'a list -> 'a t
val add_iter : 'a t -> 'a iter -> 'a t
val of_iter : 'a iter -> 'a t
val to_iter : 'a t -> 'a iter
val add_gen : 'a t -> 'a gen -> 'a t
val of_gen : 'a gen -> 'a t
val to_gen : 'a t -> 'a gen
IO
val pp : 'a printer -> 'a t printer
\ No newline at end of file diff --git a/dev/containers-data/CCGraph/Dot/index.html b/dev/containers-data/CCGraph/Dot/index.html index cc68f40d..046b5be5 100644 --- a/dev/containers-data/CCGraph/Dot/index.html +++ b/dev/containers-data/CCGraph/Dot/index.html @@ -1,5 +1,5 @@ -Dot (containers-data.CCGraph.Dot)

Module CCGraph.Dot

type attribute = [
| `Color of string
| `Shape of string
| `Weight of int
| `Style of string
| `Label of string
| `Other of string * string
]

Dot attribute

type vertex_state

Hidden state associated to a vertex

val pp : +Dot (containers-data.CCGraph.Dot)

Module CCGraph.Dot

type attribute = [
| `Color of string
| `Shape of string
| `Weight of int
| `Style of string
| `Label of string
| `Other of string * string
]

Dot attribute

type vertex_state

Hidden state associated to a vertex

val pp : tbl:( 'v, vertex_state ) table -> eq:( 'v -> 'v -> bool ) -> ?attrs_v:( 'v -> attribute list ) -> diff --git a/dev/containers-data/CCGraph/Iter/index.html b/dev/containers-data/CCGraph/Iter/index.html index 4efa9468..3410bb83 100644 --- a/dev/containers-data/CCGraph/Iter/index.html +++ b/dev/containers-data/CCGraph/Iter/index.html @@ -1,2 +1,2 @@ -Iter (containers-data.CCGraph.Iter)

Module CCGraph.Iter

type 'a t = 'a iter
val return : 'a -> 'a t
val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
val map : ( 'a -> 'b ) -> 'a t -> 'b t
val filter_map : ( 'a -> 'b option ) -> 'a t -> 'b t
val iter : ( 'a -> unit ) -> 'a t -> unit
val fold : ( 'b -> 'a -> 'b ) -> 'b -> 'a t -> 'b
val to_list : 'a t -> 'a list
\ No newline at end of file +Iter (containers-data.CCGraph.Iter)

Module CCGraph.Iter

type 'a t = 'a iter
val return : 'a -> 'a t
val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
val map : ( 'a -> 'b ) -> 'a t -> 'b t
val filter_map : ( 'a -> 'b option ) -> 'a t -> 'b t
val iter : ( 'a -> unit ) -> 'a t -> unit
val fold : ( 'b -> 'a -> 'b ) -> 'b -> 'a t -> 'b
val to_list : 'a t -> 'a list
\ No newline at end of file diff --git a/dev/containers-data/CCGraph/Lazy_tree/index.html b/dev/containers-data/CCGraph/Lazy_tree/index.html index 480f2342..e10efb1c 100644 --- a/dev/containers-data/CCGraph/Lazy_tree/index.html +++ b/dev/containers-data/CCGraph/Lazy_tree/index.html @@ -1,2 +1,2 @@ -Lazy_tree (containers-data.CCGraph.Lazy_tree)

Module CCGraph.Lazy_tree

type ('v, 'e) t = {
vertex : 'v;
children : ('e * ( 'v, 'e ) t) list Stdlib.Lazy.t;
}
val map_v : ( 'a -> 'b ) -> ( 'a, 'e ) t -> ( 'b, 'e ) t
val fold_v : ( 'acc -> 'v -> 'acc ) -> 'acc -> ( 'v, _ ) t -> 'acc
\ No newline at end of file +Lazy_tree (containers-data.CCGraph.Lazy_tree)

Module CCGraph.Lazy_tree

type ('v, 'e) t = {
vertex : 'v;
children : ('e * ( 'v, 'e ) t) list Stdlib.Lazy.t;
}
val map_v : ( 'a -> 'b ) -> ( 'a, 'e ) t -> ( 'b, 'e ) t
val fold_v : ( 'acc -> 'v -> 'acc ) -> 'acc -> ( 'v, _ ) t -> 'acc
\ No newline at end of file diff --git a/dev/containers-data/CCGraph/Map/index.html b/dev/containers-data/CCGraph/Map/index.html index ff975bb0..ed5f135d 100644 --- a/dev/containers-data/CCGraph/Map/index.html +++ b/dev/containers-data/CCGraph/Map/index.html @@ -1,2 +1,2 @@ -Map (containers-data.CCGraph.Map)

Module CCGraph.Map

Parameters

module O : Stdlib.Map.OrderedType

Signature

type vertex = O.t
type 'a t
val as_graph : 'a t -> ( vertex, 'a ) graph

Graph view of the map.

val empty : 'a t
val add_edge : vertex -> 'a -> vertex -> 'a t -> 'a t
val remove_edge : vertex -> vertex -> 'a t -> 'a t
val add : vertex -> 'a t -> 'a t

Add a vertex, possibly with no outgoing edge.

val remove : vertex -> 'a t -> 'a t

Remove the vertex and all its outgoing edges. Edges that point to the vertex are NOT removed, they must be manually removed with remove_edge.

val union : 'a t -> 'a t -> 'a t
val vertices : _ t -> vertex iter
val vertices_l : _ t -> vertex list
val of_list : (vertex * 'a * vertex) list -> 'a t
val add_list : (vertex * 'a * vertex) list -> 'a t -> 'a t
val to_list : 'a t -> (vertex * 'a * vertex) list
val of_iter : (vertex * 'a * vertex) iter -> 'a t
  • since 2.8
val add_iter : (vertex * 'a * vertex) iter -> 'a t -> 'a t
  • since 2.8
val to_iter : 'a t -> (vertex * 'a * vertex) iter
  • since 2.8
\ No newline at end of file +Map (containers-data.CCGraph.Map)

Module CCGraph.Map

Parameters

module O : Stdlib.Map.OrderedType

Signature

type vertex = O.t
type 'a t
val as_graph : 'a t -> ( vertex, 'a ) graph

Graph view of the map.

val empty : 'a t
val add_edge : vertex -> 'a -> vertex -> 'a t -> 'a t
val remove_edge : vertex -> vertex -> 'a t -> 'a t
val add : vertex -> 'a t -> 'a t

Add a vertex, possibly with no outgoing edge.

val remove : vertex -> 'a t -> 'a t

Remove the vertex and all its outgoing edges. Edges that point to the vertex are NOT removed, they must be manually removed with remove_edge.

val union : 'a t -> 'a t -> 'a t
val vertices : _ t -> vertex iter
val vertices_l : _ t -> vertex list
val of_list : (vertex * 'a * vertex) list -> 'a t
val add_list : (vertex * 'a * vertex) list -> 'a t -> 'a t
val to_list : 'a t -> (vertex * 'a * vertex) list
val of_iter : (vertex * 'a * vertex) iter -> 'a t
  • since 2.8
val add_iter : (vertex * 'a * vertex) iter -> 'a t -> 'a t
  • since 2.8
val to_iter : 'a t -> (vertex * 'a * vertex) iter
  • since 2.8
\ No newline at end of file diff --git a/dev/containers-data/CCGraph/Traverse/Event/index.html b/dev/containers-data/CCGraph/Traverse/Event/index.html index bf90b6d5..d154dae9 100644 --- a/dev/containers-data/CCGraph/Traverse/Event/index.html +++ b/dev/containers-data/CCGraph/Traverse/Event/index.html @@ -1,5 +1,5 @@ -Event (containers-data.CCGraph.Traverse.Event)

Module Traverse.Event

More detailed interface

type edge_kind = [
| `Forward
| `Back
| `Cross
]
type ('v, 'e) t = [
| `Enter of 'v * int * ( 'v, 'e ) path
| `Exit of 'v
| `Edge of 'v * 'e * 'v * edge_kind
]

A traversal is a sequence of such events

val get_vertex : ( 'v, 'e ) t -> ('v * [ `Enter | `Exit ]) option
val get_enter : ( 'v, 'e ) t -> 'v option
val get_exit : ( 'v, 'e ) t -> 'v option
val get_edge : ( 'v, 'e ) t -> ('v * 'e * 'v) option
val get_edge_kind : ( 'v, 'e ) t -> ('v * 'e * 'v * edge_kind) option
val dfs : +Event (containers-data.CCGraph.Traverse.Event)

Module Traverse.Event

More detailed interface

type edge_kind = [
| `Forward
| `Back
| `Cross
]
type ('v, 'e) t = [
| `Enter of 'v * int * ( 'v, 'e ) path
| `Exit of 'v
| `Edge of 'v * 'e * 'v * edge_kind
]

A traversal is a sequence of such events

val get_vertex : ( 'v, 'e ) t -> ('v * [ `Enter | `Exit ]) option
val get_enter : ( 'v, 'e ) t -> 'v option
val get_exit : ( 'v, 'e ) t -> 'v option
val get_edge : ( 'v, 'e ) t -> ('v * 'e * 'v) option
val get_edge_kind : ( 'v, 'e ) t -> ('v * 'e * 'v * edge_kind) option
val dfs : tbl:'v set -> eq:( 'v -> 'v -> bool ) -> graph:( 'v, 'e ) graph -> diff --git a/dev/containers-data/CCGraph/Traverse/index.html b/dev/containers-data/CCGraph/Traverse/index.html index 8d7ffc04..b0f134ed 100644 --- a/dev/containers-data/CCGraph/Traverse/index.html +++ b/dev/containers-data/CCGraph/Traverse/index.html @@ -1,5 +1,5 @@ -Traverse (containers-data.CCGraph.Traverse)

Module CCGraph.Traverse

type ('v, 'e) path = ('v * 'e * 'v) list
val generic : +Traverse (containers-data.CCGraph.Traverse)

Module CCGraph.Traverse

type ('v, 'e) path = ('v * 'e * 'v) list
val generic : tbl:'v set -> bag:'v bag -> graph:( 'v, 'e ) t -> diff --git a/dev/containers-data/CCGraph/index.html b/dev/containers-data/CCGraph/index.html index 2cef21af..8ec4d294 100644 --- a/dev/containers-data/CCGraph/index.html +++ b/dev/containers-data/CCGraph/index.html @@ -1,5 +1,5 @@ -CCGraph (containers-data.CCGraph)

Module CCGraph

Simple Graph Interface

A collections of algorithms on (mostly read-only) graph structures. The user provides her own graph structure as a ('v, 'e) CCGraph.t, where 'v is the type of vertices and 'e the type of edges (for instance, 'e = ('v * 'v) is perfectly fine in many cases).

Such a ('v, 'e) CCGraph.t structure is a record containing three functions: two relate edges to their origin and destination, and one maps vertices to their outgoing edges. This abstract notion of graph makes it possible to run the algorithms on any user-specific type that happens to have a graph structure.

Many graph algorithms here take an iterator of vertices as input. The helper module Iter contains basic functions for that, as does the iter library on opam. If the user only has a single vertex (e.g., for a topological sort from a given vertex), they can use Iter.return x to build a iter of one element.

status: unstable

  • since 0.12

Iter Helpers

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

A sequence of items of type 'a, possibly infinite

  • since 2.8
type 'a iter_once = 'a iter

Iter that should be used only once

  • since 2.8
exception Iter_once

Raised when a sequence meant to be used once is used several times.

module Iter : sig ... end

Interfaces for graphs

This interface is designed for oriented graphs with labels on edges

type ('v, 'e) t = 'v -> ('e * 'v) iter

Directed graph with vertices of type 'v and edges labeled with e'

type ('v, 'e) graph = ( 'v, 'e ) t
val make : ( 'v -> ('e * 'v) iter ) -> ( 'v, 'e ) t

Make a graph by providing the children function.

type 'v tag_set = {
get_tag : 'v -> bool;
set_tag : 'v -> unit;(*

Set tag for the given element

*)
}

Tags

Mutable tags from values of type 'v to tags of type bool

type ('k, 'a) table = {
mem : 'k -> bool;
find : 'k -> 'a;(*
  • raises Not_found

    if element not added before

*)
add : 'k -> 'a -> unit;(*

Erases previous binding

*)
}

Table

Mutable table with keys 'k and values 'a

type 'a set = ( 'a, unit ) table

Mutable set

val mk_table : +CCGraph (containers-data.CCGraph)

Module CCGraph

Simple Graph Interface

A collections of algorithms on (mostly read-only) graph structures. The user provides her own graph structure as a ('v, 'e) CCGraph.t, where 'v is the type of vertices and 'e the type of edges (for instance, 'e = ('v * 'v) is perfectly fine in many cases).

Such a ('v, 'e) CCGraph.t structure is a record containing three functions: two relate edges to their origin and destination, and one maps vertices to their outgoing edges. This abstract notion of graph makes it possible to run the algorithms on any user-specific type that happens to have a graph structure.

Many graph algorithms here take an iterator of vertices as input. The helper module Iter contains basic functions for that, as does the iter library on opam. If the user only has a single vertex (e.g., for a topological sort from a given vertex), they can use Iter.return x to build a iter of one element.

status: unstable

  • since 0.12

Iter Helpers

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

A sequence of items of type 'a, possibly infinite

  • since 2.8
type 'a iter_once = 'a iter

Iter that should be used only once

  • since 2.8
exception Iter_once

Raised when a sequence meant to be used once is used several times.

module Iter : sig ... end

Interfaces for graphs

This interface is designed for oriented graphs with labels on edges

type ('v, 'e) t = 'v -> ('e * 'v) iter

Directed graph with vertices of type 'v and edges labeled with e'

type ('v, 'e) graph = ( 'v, 'e ) t
val make : ( 'v -> ('e * 'v) iter ) -> ( 'v, 'e ) t

Make a graph by providing the children function.

type 'v tag_set = {
get_tag : 'v -> bool;
set_tag : 'v -> unit;(*

Set tag for the given element

*)
}

Tags

Mutable tags from values of type 'v to tags of type bool

type ('k, 'a) table = {
mem : 'k -> bool;
find : 'k -> 'a;(*
  • raises Not_found

    if element not added before

*)
add : 'k -> 'a -> unit;(*

Erases previous binding

*)
}

Table

Mutable table with keys 'k and values 'a

type 'a set = ( 'a, unit ) table

Mutable set

val mk_table : eq:( 'k -> 'k -> bool ) -> ?hash:( 'k -> int ) -> int -> diff --git a/dev/containers-data/CCGraph/module-type-MAP/index.html b/dev/containers-data/CCGraph/module-type-MAP/index.html index 0cd468e9..8723c250 100644 --- a/dev/containers-data/CCGraph/module-type-MAP/index.html +++ b/dev/containers-data/CCGraph/module-type-MAP/index.html @@ -1,2 +1,2 @@ -MAP (containers-data.CCGraph.MAP)

Module type CCGraph.MAP

type vertex
type 'a t
val as_graph : 'a t -> ( vertex, 'a ) graph

Graph view of the map.

val empty : 'a t
val add_edge : vertex -> 'a -> vertex -> 'a t -> 'a t
val remove_edge : vertex -> vertex -> 'a t -> 'a t
val add : vertex -> 'a t -> 'a t

Add a vertex, possibly with no outgoing edge.

val remove : vertex -> 'a t -> 'a t

Remove the vertex and all its outgoing edges. Edges that point to the vertex are NOT removed, they must be manually removed with remove_edge.

val union : 'a t -> 'a t -> 'a t
val vertices : _ t -> vertex iter
val vertices_l : _ t -> vertex list
val of_list : (vertex * 'a * vertex) list -> 'a t
val add_list : (vertex * 'a * vertex) list -> 'a t -> 'a t
val to_list : 'a t -> (vertex * 'a * vertex) list
val of_iter : (vertex * 'a * vertex) iter -> 'a t
  • since 2.8
val add_iter : (vertex * 'a * vertex) iter -> 'a t -> 'a t
  • since 2.8
val to_iter : 'a t -> (vertex * 'a * vertex) iter
  • since 2.8
\ No newline at end of file +MAP (containers-data.CCGraph.MAP)

Module type CCGraph.MAP

type vertex
type 'a t
val as_graph : 'a t -> ( vertex, 'a ) graph

Graph view of the map.

val empty : 'a t
val add_edge : vertex -> 'a -> vertex -> 'a t -> 'a t
val remove_edge : vertex -> vertex -> 'a t -> 'a t
val add : vertex -> 'a t -> 'a t

Add a vertex, possibly with no outgoing edge.

val remove : vertex -> 'a t -> 'a t

Remove the vertex and all its outgoing edges. Edges that point to the vertex are NOT removed, they must be manually removed with remove_edge.

val union : 'a t -> 'a t -> 'a t
val vertices : _ t -> vertex iter
val vertices_l : _ t -> vertex list
val of_list : (vertex * 'a * vertex) list -> 'a t
val add_list : (vertex * 'a * vertex) list -> 'a t -> 'a t
val to_list : 'a t -> (vertex * 'a * vertex) list
val of_iter : (vertex * 'a * vertex) iter -> 'a t
  • since 2.8
val add_iter : (vertex * 'a * vertex) iter -> 'a t -> 'a t
  • since 2.8
val to_iter : 'a t -> (vertex * 'a * vertex) iter
  • since 2.8
\ No newline at end of file diff --git a/dev/containers-data/CCHashSet/Make/argument-1-E/index.html b/dev/containers-data/CCHashSet/Make/argument-1-E/index.html index 2d01f30a..4dcbdb86 100644 --- a/dev/containers-data/CCHashSet/Make/argument-1-E/index.html +++ b/dev/containers-data/CCHashSet/Make/argument-1-E/index.html @@ -1,2 +1,2 @@ -E (containers-data.CCHashSet.Make.1-E)

Parameter Make.1-E

type t
val equal : t -> t -> bool
val hash : t -> int

Positive value

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

Parameter Make.1-E

type t
val equal : t -> t -> bool
val hash : t -> int

Positive value

\ No newline at end of file diff --git a/dev/containers-data/CCHashSet/Make/index.html b/dev/containers-data/CCHashSet/Make/index.html index 6953207a..229e31cf 100644 --- a/dev/containers-data/CCHashSet/Make/index.html +++ b/dev/containers-data/CCHashSet/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCHashSet.Make)

Module CCHashSet.Make

Parameters

module E : ELEMENT

Signature

type t
type elt = E.t
val create : int -> t

create n makes a new set with the given capacity n.

val singleton : elt -> t

singleton x is the singleton {x}.

val clear : t -> unit

clear s removes all elements from s.

val copy : t -> t

Fresh copy.

val copy_into : into:t -> t -> unit

copy_into ~into s copies all elements of s into into.

val insert : t -> elt -> unit

insert s x adds x into s.

val remove : t -> elt -> unit

Remove the element, if it were in there.

val cardinal : t -> int

cardinal s returns the number of elements in s.

val mem : t -> elt -> bool

mem s x returns true iff x is in s.

val find_exn : t -> elt -> elt

find_exn s x returns y if x and y are equal, and mem s y.

  • raises Not_found

    if x not in s.

val find : t -> elt -> elt option

Safe version of find_exn.

val inter : t -> t -> t

inter a b returns a ∩ b.

val inter_mut : into:t -> t -> unit

inter_mut ~into a changes into into a ∩ into.

val union : t -> t -> t

union a b returns a ∪ b.

val union_mut : into:t -> t -> unit

union_mut ~into a changes into into a ∪ into.

val diff : t -> t -> t

diff a b returns a - b.

val subset : t -> t -> bool

subset a b returns true if all elements of a are in b.

val equal : t -> t -> bool

equal a b is extensional equality (a and b have the same elements).

val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val iter : ( elt -> unit ) -> t -> unit

Iterate on values.

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

Fold on values.

val elements : t -> elt list

List of elements.

val of_list : elt list -> t
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val add_iter : t -> elt iter -> unit
val pp : ?pp_sep:unit printer -> elt printer -> t printer

pp pp_elt returns a set printer, given a printer for individual elements.

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

Module CCHashSet.Make

Parameters

module E : ELEMENT

Signature

type t
type elt = E.t
val create : int -> t

create n makes a new set with the given capacity n.

val singleton : elt -> t

singleton x is the singleton {x}.

val clear : t -> unit

clear s removes all elements from s.

val copy : t -> t

Fresh copy.

val copy_into : into:t -> t -> unit

copy_into ~into s copies all elements of s into into.

val insert : t -> elt -> unit

insert s x adds x into s.

val remove : t -> elt -> unit

Remove the element, if it were in there.

val cardinal : t -> int

cardinal s returns the number of elements in s.

val mem : t -> elt -> bool

mem s x returns true iff x is in s.

val find_exn : t -> elt -> elt

find_exn s x returns y if x and y are equal, and mem s y.

  • raises Not_found

    if x not in s.

val find : t -> elt -> elt option

Safe version of find_exn.

val inter : t -> t -> t

inter a b returns a ∩ b.

val inter_mut : into:t -> t -> unit

inter_mut ~into a changes into into a ∩ into.

val union : t -> t -> t

union a b returns a ∪ b.

val union_mut : into:t -> t -> unit

union_mut ~into a changes into into a ∪ into.

val diff : t -> t -> t

diff a b returns a - b.

val subset : t -> t -> bool

subset a b returns true if all elements of a are in b.

val equal : t -> t -> bool

equal a b is extensional equality (a and b have the same elements).

val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val iter : ( elt -> unit ) -> t -> unit

Iterate on values.

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

Fold on values.

val elements : t -> elt list

List of elements.

val of_list : elt list -> t
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val add_iter : t -> elt iter -> unit
val pp : ?pp_sep:unit printer -> elt printer -> t printer

pp pp_elt returns a set printer, given a printer for individual elements.

\ No newline at end of file diff --git a/dev/containers-data/CCHashSet/index.html b/dev/containers-data/CCHashSet/index.html index 6580eb59..9e630b5c 100644 --- a/dev/containers-data/CCHashSet/index.html +++ b/dev/containers-data/CCHashSet/index.html @@ -1,2 +1,2 @@ -CCHashSet (containers-data.CCHashSet)

Module CCHashSet

Mutable Set

status: unstable

  • since 0.13
type 'a iter = ( 'a -> unit ) -> unit
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type S = sig ... end
module type ELEMENT = sig ... end
module Make (E : ELEMENT) : S with type elt = E.t
\ No newline at end of file +CCHashSet (containers-data.CCHashSet)

Module CCHashSet

Mutable Set

status: unstable

  • since 0.13
type 'a iter = ( 'a -> unit ) -> unit
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type S = sig ... end
module type ELEMENT = sig ... end
module Make (E : ELEMENT) : S with type elt = E.t
\ No newline at end of file diff --git a/dev/containers-data/CCHashSet/module-type-ELEMENT/index.html b/dev/containers-data/CCHashSet/module-type-ELEMENT/index.html index 759934dd..01e04e6d 100644 --- a/dev/containers-data/CCHashSet/module-type-ELEMENT/index.html +++ b/dev/containers-data/CCHashSet/module-type-ELEMENT/index.html @@ -1,2 +1,2 @@ -ELEMENT (containers-data.CCHashSet.ELEMENT)

Module type CCHashSet.ELEMENT

type t
val equal : t -> t -> bool
val hash : t -> int

Positive value

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

Module type CCHashSet.ELEMENT

type t
val equal : t -> t -> bool
val hash : t -> int

Positive value

\ No newline at end of file diff --git a/dev/containers-data/CCHashSet/module-type-S/index.html b/dev/containers-data/CCHashSet/module-type-S/index.html index 5c2228cb..86e68ed8 100644 --- a/dev/containers-data/CCHashSet/module-type-S/index.html +++ b/dev/containers-data/CCHashSet/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCHashSet.S)

Module type CCHashSet.S

type t
type elt
val create : int -> t

create n makes a new set with the given capacity n.

val singleton : elt -> t

singleton x is the singleton {x}.

val clear : t -> unit

clear s removes all elements from s.

val copy : t -> t

Fresh copy.

val copy_into : into:t -> t -> unit

copy_into ~into s copies all elements of s into into.

val insert : t -> elt -> unit

insert s x adds x into s.

val remove : t -> elt -> unit

Remove the element, if it were in there.

val cardinal : t -> int

cardinal s returns the number of elements in s.

val mem : t -> elt -> bool

mem s x returns true iff x is in s.

val find_exn : t -> elt -> elt

find_exn s x returns y if x and y are equal, and mem s y.

  • raises Not_found

    if x not in s.

val find : t -> elt -> elt option

Safe version of find_exn.

val inter : t -> t -> t

inter a b returns a ∩ b.

val inter_mut : into:t -> t -> unit

inter_mut ~into a changes into into a ∩ into.

val union : t -> t -> t

union a b returns a ∪ b.

val union_mut : into:t -> t -> unit

union_mut ~into a changes into into a ∪ into.

val diff : t -> t -> t

diff a b returns a - b.

val subset : t -> t -> bool

subset a b returns true if all elements of a are in b.

val equal : t -> t -> bool

equal a b is extensional equality (a and b have the same elements).

val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val iter : ( elt -> unit ) -> t -> unit

Iterate on values.

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

Fold on values.

val elements : t -> elt list

List of elements.

val of_list : elt list -> t
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val add_iter : t -> elt iter -> unit
val pp : ?pp_sep:unit printer -> elt printer -> t printer

pp pp_elt returns a set printer, given a printer for individual elements.

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

Module type CCHashSet.S

type t
type elt
val create : int -> t

create n makes a new set with the given capacity n.

val singleton : elt -> t

singleton x is the singleton {x}.

val clear : t -> unit

clear s removes all elements from s.

val copy : t -> t

Fresh copy.

val copy_into : into:t -> t -> unit

copy_into ~into s copies all elements of s into into.

val insert : t -> elt -> unit

insert s x adds x into s.

val remove : t -> elt -> unit

Remove the element, if it were in there.

val cardinal : t -> int

cardinal s returns the number of elements in s.

val mem : t -> elt -> bool

mem s x returns true iff x is in s.

val find_exn : t -> elt -> elt

find_exn s x returns y if x and y are equal, and mem s y.

  • raises Not_found

    if x not in s.

val find : t -> elt -> elt option

Safe version of find_exn.

val inter : t -> t -> t

inter a b returns a ∩ b.

val inter_mut : into:t -> t -> unit

inter_mut ~into a changes into into a ∩ into.

val union : t -> t -> t

union a b returns a ∪ b.

val union_mut : into:t -> t -> unit

union_mut ~into a changes into into a ∪ into.

val diff : t -> t -> t

diff a b returns a - b.

val subset : t -> t -> bool

subset a b returns true if all elements of a are in b.

val equal : t -> t -> bool

equal a b is extensional equality (a and b have the same elements).

val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val iter : ( elt -> unit ) -> t -> unit

Iterate on values.

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

Fold on values.

val elements : t -> elt list

List of elements.

val of_list : elt list -> t
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val add_iter : t -> elt iter -> unit
val pp : ?pp_sep:unit printer -> elt printer -> t printer

pp pp_elt returns a set printer, given a printer for individual elements.

\ No newline at end of file diff --git a/dev/containers-data/CCHashTrie/Make/argument-1-K/index.html b/dev/containers-data/CCHashTrie/Make/argument-1-K/index.html index 57308aa9..ccfa81ff 100644 --- a/dev/containers-data/CCHashTrie/Make/argument-1-K/index.html +++ b/dev/containers-data/CCHashTrie/Make/argument-1-K/index.html @@ -1,2 +1,2 @@ -K (containers-data.CCHashTrie.Make.1-K)

Parameter Make.1-K

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file +K (containers-data.CCHashTrie.Make.1-K)

Parameter Make.1-K

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCHashTrie/Make/index.html b/dev/containers-data/CCHashTrie/Make/index.html index e1a72d71..15d736f8 100644 --- a/dev/containers-data/CCHashTrie/Make/index.html +++ b/dev/containers-data/CCHashTrie/Make/index.html @@ -1,5 +1,5 @@ -Make (containers-data.CCHashTrie.Make)

Module CCHashTrie.Make

Functors

Parameters

module K : KEY

Signature

type key = K.t
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val add : key -> 'a -> 'a t -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if key not present.

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val update : key -> f:( 'a option -> 'a option ) -> 'a t -> 'a t

update k ~f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a t

add_mut ~id k v m behaves like add k v m, except it will mutate in place whenever possible. Changes done with an id might affect all versions of the structure obtained with the same id (but not other versions).

  • raises Transient.Frozen

    if id is frozen.

val remove_mut : id:Transient.t -> key -> 'a t -> 'a t

Same as remove, but modifies in place whenever possible.

  • raises Transient.Frozen

    if id is frozen.

val update_mut : +Make (containers-data.CCHashTrie.Make)

Module CCHashTrie.Make

Functors

Parameters

module K : KEY

Signature

type key = K.t
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val add : key -> 'a -> 'a t -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if key not present.

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val update : key -> f:( 'a option -> 'a option ) -> 'a t -> 'a t

update k ~f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a t

add_mut ~id k v m behaves like add k v m, except it will mutate in place whenever possible. Changes done with an id might affect all versions of the structure obtained with the same id (but not other versions).

  • raises Transient.Frozen

    if id is frozen.

val remove_mut : id:Transient.t -> key -> 'a t -> 'a t

Same as remove, but modifies in place whenever possible.

  • raises Transient.Frozen

    if id is frozen.

val update_mut : id:Transient.t -> key -> f:( 'a option -> 'a option ) -> diff --git a/dev/containers-data/CCHashTrie/Transient/index.html b/dev/containers-data/CCHashTrie/Transient/index.html index d7e1bc20..541fb8ae 100644 --- a/dev/containers-data/CCHashTrie/Transient/index.html +++ b/dev/containers-data/CCHashTrie/Transient/index.html @@ -1,2 +1,2 @@ -Transient (containers-data.CCHashTrie.Transient)

Module CCHashTrie.Transient

Transient Identifiers

type t

Identifiers for transient modifications. A transient modification is uniquely identified by a Transient.t. Once Transient.freeze r is called, r cannot be used to modify the structure again.

val create : unit -> t

Create a new, active ID.

val equal : t -> t -> bool

Equality between IDs.

val frozen : t -> bool

frozen i returns true if freeze i was called before. In this case, the ID cannot be used for modifications again.

val active : t -> bool

active i is not (frozen i).

val freeze : t -> unit

freeze i makes i unusable for new modifications. The values created with i will now be immutable.

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

with_ f creates a transient ID i, calls f i, freezes the ID i and returns the result of f i.

exception Frozen

Raised when a frozen ID is used.

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

Module CCHashTrie.Transient

Transient Identifiers

type t

Identifiers for transient modifications. A transient modification is uniquely identified by a Transient.t. Once Transient.freeze r is called, r cannot be used to modify the structure again.

val create : unit -> t

Create a new, active ID.

val equal : t -> t -> bool

Equality between IDs.

val frozen : t -> bool

frozen i returns true if freeze i was called before. In this case, the ID cannot be used for modifications again.

val active : t -> bool

active i is not (frozen i).

val freeze : t -> unit

freeze i makes i unusable for new modifications. The values created with i will now be immutable.

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

with_ f creates a transient ID i, calls f i, freezes the ID i and returns the result of f i.

exception Frozen

Raised when a frozen ID is used.

\ No newline at end of file diff --git a/dev/containers-data/CCHashTrie/index.html b/dev/containers-data/CCHashTrie/index.html index 2eaa7f68..34bb866a 100644 --- a/dev/containers-data/CCHashTrie/index.html +++ b/dev/containers-data/CCHashTrie/index.html @@ -1,2 +1,2 @@ -CCHashTrie (containers-data.CCHashTrie)

Module CCHashTrie

Hash Tries

Trie indexed by the hash of the keys, where the branching factor is fixed. The goal is to have a quite efficient functional structure with fast update and access if the hash function is good. The trie is not binary, to improve cache locality and decrease depth.

Preliminary benchmarks (see the "tbl" section of benchmarks) tend to show that this type is quite efficient for small data sets.

status: unstable

  • since 0.13
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]
module Transient : sig ... end
module type S = sig ... end
module type KEY = sig ... end
module Make (K : KEY) : S with type key = K.t
\ No newline at end of file +CCHashTrie (containers-data.CCHashTrie)

Module CCHashTrie

Hash Tries

Trie indexed by the hash of the keys, where the branching factor is fixed. The goal is to have a quite efficient functional structure with fast update and access if the hash function is good. The trie is not binary, to improve cache locality and decrease depth.

Preliminary benchmarks (see the "tbl" section of benchmarks) tend to show that this type is quite efficient for small data sets.

status: unstable

  • since 0.13
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]
module Transient : sig ... end
module type S = sig ... end
module type KEY = sig ... end
module Make (K : KEY) : S with type key = K.t
\ No newline at end of file diff --git a/dev/containers-data/CCHashTrie/module-type-KEY/index.html b/dev/containers-data/CCHashTrie/module-type-KEY/index.html index 3c2b3435..46b1c0a6 100644 --- a/dev/containers-data/CCHashTrie/module-type-KEY/index.html +++ b/dev/containers-data/CCHashTrie/module-type-KEY/index.html @@ -1,2 +1,2 @@ -KEY (containers-data.CCHashTrie.KEY)

Module type CCHashTrie.KEY

Type for keys

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file +KEY (containers-data.CCHashTrie.KEY)

Module type CCHashTrie.KEY

Type for keys

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCHashTrie/module-type-S/index.html b/dev/containers-data/CCHashTrie/module-type-S/index.html index 124b7b81..57c1b366 100644 --- a/dev/containers-data/CCHashTrie/module-type-S/index.html +++ b/dev/containers-data/CCHashTrie/module-type-S/index.html @@ -1,5 +1,5 @@ -S (containers-data.CCHashTrie.S)

Module type CCHashTrie.S

Signature

type key
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val add : key -> 'a -> 'a t -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if key not present.

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val update : key -> f:( 'a option -> 'a option ) -> 'a t -> 'a t

update k ~f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a t

add_mut ~id k v m behaves like add k v m, except it will mutate in place whenever possible. Changes done with an id might affect all versions of the structure obtained with the same id (but not other versions).

  • raises Transient.Frozen

    if id is frozen.

val remove_mut : id:Transient.t -> key -> 'a t -> 'a t

Same as remove, but modifies in place whenever possible.

  • raises Transient.Frozen

    if id is frozen.

val update_mut : +S (containers-data.CCHashTrie.S)

Module type CCHashTrie.S

Signature

type key
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val add : key -> 'a -> 'a t -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if key not present.

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val update : key -> f:( 'a option -> 'a option ) -> 'a t -> 'a t

update k ~f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a t

add_mut ~id k v m behaves like add k v m, except it will mutate in place whenever possible. Changes done with an id might affect all versions of the structure obtained with the same id (but not other versions).

  • raises Transient.Frozen

    if id is frozen.

val remove_mut : id:Transient.t -> key -> 'a t -> 'a t

Same as remove, but modifies in place whenever possible.

  • raises Transient.Frozen

    if id is frozen.

val update_mut : id:Transient.t -> key -> f:( 'a option -> 'a option ) -> diff --git a/dev/containers-data/CCHet/Key/index.html b/dev/containers-data/CCHet/Key/index.html index 91dff501..c4809928 100644 --- a/dev/containers-data/CCHet/Key/index.html +++ b/dev/containers-data/CCHet/Key/index.html @@ -1,2 +1,2 @@ -Key (containers-data.CCHet.Key)

Module CCHet.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types.

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

Module CCHet.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types.

\ No newline at end of file diff --git a/dev/containers-data/CCHet/Map/index.html b/dev/containers-data/CCHet/Map/index.html index 827c64c4..279d4829 100644 --- a/dev/containers-data/CCHet/Map/index.html +++ b/dev/containers-data/CCHet/Map/index.html @@ -1,2 +1,2 @@ -Map (containers-data.CCHet.Map)

Module CCHet.Map

Immutable map

type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val remove : _ Key.t -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
  • raises Not_found

    if the key is not in the table.

val iter : ( pair -> unit ) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file +Map (containers-data.CCHet.Map)

Module CCHet.Map

Immutable map

type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val remove : _ Key.t -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
  • raises Not_found

    if the key is not in the table.

val iter : ( pair -> unit ) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/containers-data/CCHet/Tbl/index.html b/dev/containers-data/CCHet/Tbl/index.html index de55e266..94c97285 100644 --- a/dev/containers-data/CCHet/Tbl/index.html +++ b/dev/containers-data/CCHet/Tbl/index.html @@ -1,2 +1,2 @@ -Tbl (containers-data.CCHet.Tbl)

Module CCHet.Tbl

Imperative table indexed by Key

type t
val create : ?size:int -> unit -> t
val mem : t -> _ Key.t -> bool
val add : t -> 'a Key.t -> 'a -> unit
val remove : t -> _ Key.t -> unit
val length : t -> int
val find : t -> 'a Key.t -> 'a option
val find_exn : t -> 'a Key.t -> 'a
  • raises Not_found

    if the key is not in the table.

val iter : ( pair -> unit ) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> unit
val add_list : t -> pair list -> unit
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file +Tbl (containers-data.CCHet.Tbl)

Module CCHet.Tbl

Imperative table indexed by Key

type t
val create : ?size:int -> unit -> t
val mem : t -> _ Key.t -> bool
val add : t -> 'a Key.t -> 'a -> unit
val remove : t -> _ Key.t -> unit
val length : t -> int
val find : t -> 'a Key.t -> 'a option
val find_exn : t -> 'a Key.t -> 'a
  • raises Not_found

    if the key is not in the table.

val iter : ( pair -> unit ) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> unit
val add_list : t -> pair list -> unit
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/containers-data/CCHet/index.html b/dev/containers-data/CCHet/index.html index 600e76a3..660d9afd 100644 --- a/dev/containers-data/CCHet/index.html +++ b/dev/containers-data/CCHet/index.html @@ -1,2 +1,2 @@ -CCHet (containers-data.CCHet)

Module CCHet

Associative containers with Heterogeneous Values

This is similar to CCMixtbl, but the injection is directly used as a key.

  • since 0.17
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
module Key : sig ... end
type pair =
| Pair : 'a Key.t * 'a -> pair
module Tbl : sig ... end
module Map : sig ... end
\ No newline at end of file +CCHet (containers-data.CCHet)

Module CCHet

Associative containers with Heterogeneous Values

This is similar to CCMixtbl, but the injection is directly used as a key.

  • since 0.17
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
module Key : sig ... end
type pair =
| Pair : 'a Key.t * 'a -> pair
module Tbl : sig ... end
module Map : sig ... end
\ No newline at end of file diff --git a/dev/containers-data/CCImmutArray/index.html b/dev/containers-data/CCImmutArray/index.html index 5b19f86c..128c7322 100644 --- a/dev/containers-data/CCImmutArray/index.html +++ b/dev/containers-data/CCImmutArray/index.html @@ -1,5 +1,5 @@ -CCImmutArray (containers-data.CCImmutArray)

Module CCImmutArray

Immutable Arrays

Purely functional use of arrays. Update is costly, but reads are very fast. Sadly, it is not possible to make this type covariant without using black magic.

  • since 0.17
type 'a t

Array of values of type 'a. The underlying type really is an array, but it will never be modified.

It should be covariant but OCaml will not accept it.

val empty : 'a t
val length : _ t -> int
val singleton : 'a -> 'a t
val doubleton : 'a -> 'a -> 'a t
val make : int -> 'a -> 'a t

make n x makes an array of n times x.

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

init n f makes the array [| f 0; f 1; ... ; f (n-1) |].

  • raises Invalid_argument

    if n < 0.

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

Access the element.

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

Copy the array and modify its copy.

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

sub a start len returns a fresh array of length len, containing the elements from start to pstart + len - 1 of array a.

Raises Invalid_argument "Array.sub" if start and len do not designate a valid subarray of a; that is, if start < 0, or len < 0, or start + len > Array.length a.

  • since 1.5
val map : ( 'a -> 'b ) -> 'a t -> 'b t
val mapi : ( int -> 'a -> 'b ) -> 'a t -> 'b t
val append : 'a t -> 'a t -> 'a t
val iter : ( 'a -> unit ) -> 'a t -> unit
val iteri : ( int -> 'a -> unit ) -> 'a t -> unit
val foldi : ( 'a -> int -> 'b -> 'a ) -> 'a -> 'b t -> 'a
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'a
val for_all : ( 'a -> bool ) -> 'a t -> bool
val exists : ( 'a -> bool ) -> 'a t -> bool

Conversions

type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list
val of_array_unsafe : 'a array -> 'a t

Take ownership of the given array. Careful, the array must NOT be modified afterwards!

val to_iter : 'a t -> 'a iter
val of_iter : 'a iter -> 'a t
val of_gen : 'a gen -> 'a t
val to_gen : 'a t -> 'a gen

IO

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : +CCImmutArray (containers-data.CCImmutArray)

Module CCImmutArray

Immutable Arrays

Purely functional use of arrays. Update is costly, but reads are very fast. Sadly, it is not possible to make this type covariant without using black magic.

  • since 0.17
type 'a t

Array of values of type 'a. The underlying type really is an array, but it will never be modified.

It should be covariant but OCaml will not accept it.

val empty : 'a t
val length : _ t -> int
val singleton : 'a -> 'a t
val doubleton : 'a -> 'a -> 'a t
val make : int -> 'a -> 'a t

make n x makes an array of n times x.

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

init n f makes the array [| f 0; f 1; ... ; f (n-1) |].

  • raises Invalid_argument

    if n < 0.

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

Access the element.

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

Copy the array and modify its copy.

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

sub a start len returns a fresh array of length len, containing the elements from start to pstart + len - 1 of array a.

Raises Invalid_argument "Array.sub" if start and len do not designate a valid subarray of a; that is, if start < 0, or len < 0, or start + len > Array.length a.

  • since 1.5
val map : ( 'a -> 'b ) -> 'a t -> 'b t
val mapi : ( int -> 'a -> 'b ) -> 'a t -> 'b t
val append : 'a t -> 'a t -> 'a t
val iter : ( 'a -> unit ) -> 'a t -> unit
val iteri : ( int -> 'a -> unit ) -> 'a t -> unit
val foldi : ( 'a -> int -> 'b -> 'a ) -> 'a -> 'b t -> 'a
val fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b t -> 'a
val for_all : ( 'a -> bool ) -> 'a t -> bool
val exists : ( 'a -> bool ) -> 'a t -> bool

Conversions

type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list
val of_array_unsafe : 'a array -> 'a t

Take ownership of the given array. Careful, the array must NOT be modified afterwards!

val to_iter : 'a t -> 'a iter
val of_iter : 'a iter -> 'a t
val of_gen : 'a gen -> 'a t
val to_gen : 'a t -> 'a gen

IO

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> diff --git a/dev/containers-data/CCIntMap/index.html b/dev/containers-data/CCIntMap/index.html index 9c0cf662..e7335e99 100644 --- a/dev/containers-data/CCIntMap/index.html +++ b/dev/containers-data/CCIntMap/index.html @@ -1,5 +1,5 @@ -CCIntMap (containers-data.CCIntMap)

Module CCIntMap

Map specialized for Int keys

status: stable

  • since 0.10
type +'a t
val empty : 'a t
val is_empty : _ t -> bool

Is the map empty?

  • since 2.3
val singleton : int -> 'a -> 'a t
val doubleton : int -> 'a -> int -> 'a -> 'a t
val mem : int -> _ t -> bool
val find : int -> 'a t -> 'a option
val find_exn : int -> 'a t -> 'a

Same as find but unsafe.

  • raises Not_found

    if key is not present.

val add : int -> 'a -> 'a t -> 'a t
val remove : int -> 'a t -> 'a t
val equal : eq:( 'a -> 'a -> bool ) -> 'a t -> 'a t -> bool

equal ~eq a b checks whether a and b have the same set of pairs (key, value), comparing values with eq.

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

Total order between maps; the precise order is unspecified.

  • since 0.13
val update : int -> ( 'a option -> 'a option ) -> 'a t -> 'a t
val filter : ( int -> 'a -> bool ) -> 'a t -> 'a t

Filter values using the given predicate

  • since 2.3
val filter_map : ( int -> 'a -> 'b option ) -> 'a t -> 'b t

Filter-map values using the given function

  • since 2.3
val cardinal : _ t -> int

Number of bindings in the map. Linear time.

val iter : ( int -> 'a -> unit ) -> 'a t -> unit
val fold : ( int -> 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b
val mapi : ( int -> 'a -> 'b ) -> 'a t -> 'b t
  • since 0.17
val map : ( 'a -> 'b ) -> 'a t -> 'b t
  • since 0.17
val choose : 'a t -> (int * 'a) option
val choose_exn : 'a t -> int * 'a
  • raises Not_found

    if not pair was found.

val union : ( int -> 'a -> 'a -> 'a ) -> 'a t -> 'a t -> 'a t
val inter : ( int -> 'a -> 'a -> 'a ) -> 'a t -> 'a t -> 'a t
val merge : +CCIntMap (containers-data.CCIntMap)

Module CCIntMap

Map specialized for Int keys

status: stable

  • since 0.10
type +'a t
val empty : 'a t
val is_empty : _ t -> bool

Is the map empty?

  • since 2.3
val singleton : int -> 'a -> 'a t
val doubleton : int -> 'a -> int -> 'a -> 'a t
val mem : int -> _ t -> bool
val find : int -> 'a t -> 'a option
val find_exn : int -> 'a t -> 'a

Same as find but unsafe.

  • raises Not_found

    if key is not present.

val add : int -> 'a -> 'a t -> 'a t
val remove : int -> 'a t -> 'a t
val equal : eq:( 'a -> 'a -> bool ) -> 'a t -> 'a t -> bool

equal ~eq a b checks whether a and b have the same set of pairs (key, value), comparing values with eq.

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

Total order between maps; the precise order is unspecified.

  • since 0.13
val update : int -> ( 'a option -> 'a option ) -> 'a t -> 'a t
val filter : ( int -> 'a -> bool ) -> 'a t -> 'a t

Filter values using the given predicate

  • since 2.3
val filter_map : ( int -> 'a -> 'b option ) -> 'a t -> 'b t

Filter-map values using the given function

  • since 2.3
val cardinal : _ t -> int

Number of bindings in the map. Linear time.

val iter : ( int -> 'a -> unit ) -> 'a t -> unit
val fold : ( int -> 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b
val mapi : ( int -> 'a -> 'b ) -> 'a t -> 'b t
  • since 0.17
val map : ( 'a -> 'b ) -> 'a t -> 'b t
  • since 0.17
val choose : 'a t -> (int * 'a) option
val choose_exn : 'a t -> int * 'a
  • raises Not_found

    if not pair was found.

val union : ( int -> 'a -> 'a -> 'a ) -> 'a t -> 'a t -> 'a t
val inter : ( int -> 'a -> 'a -> 'a ) -> 'a t -> 'a t -> 'a t
val merge : f:( int -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers-data/CCKTree/Dot/index.html b/dev/containers-data/CCKTree/Dot/index.html index 9199dc66..dca613c9 100644 --- a/dev/containers-data/CCKTree/Dot/index.html +++ b/dev/containers-data/CCKTree/Dot/index.html @@ -1,2 +1,2 @@ -Dot (containers-data.CCKTree.Dot)

Module CCKTree.Dot

type attribute = [
| `Color of string
| `Shape of string
| `Weight of int
| `Style of string
| `Label of string
| `Id of string(*

Unique ID in the graph. Allows sharing.

*)
| `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 +Dot (containers-data.CCKTree.Dot)

Module CCKTree.Dot

type attribute = [
| `Color of string
| `Shape of string
| `Weight of int
| `Style of string
| `Label of string
| `Id of string(*

Unique ID in the graph. Allows sharing.

*)
| `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 index 5162b655..2120caef 100644 --- a/dev/containers-data/CCKTree/class-type-pset/index.html +++ b/dev/containers-data/CCKTree/class-type-pset/index.html @@ -1,2 +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 +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 f7e2bbaa..9b1df9f2 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. 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 =
   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/CCLazy_list/Infix/index.html b/dev/containers-data/CCLazy_list/Infix/index.html
index 9f0b1b39..47555026 100644
--- a/dev/containers-data/CCLazy_list/Infix/index.html
+++ b/dev/containers-data/CCLazy_list/Infix/index.html
@@ -1,2 +1,2 @@
 
-Infix (containers-data.CCLazy_list.Infix)

Module CCLazy_list.Infix

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

Alias to default.

  • since 2.1
\ No newline at end of file +Infix (containers-data.CCLazy_list.Infix)

Module CCLazy_list.Infix

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

Alias to default.

  • since 2.1
\ No newline at end of file diff --git a/dev/containers-data/CCLazy_list/index.html b/dev/containers-data/CCLazy_list/index.html index 40729ceb..1ab90df4 100644 --- a/dev/containers-data/CCLazy_list/index.html +++ b/dev/containers-data/CCLazy_list/index.html @@ -1,2 +1,2 @@ -CCLazy_list (containers-data.CCLazy_list)

Module CCLazy_list

Lazy List

  • since 0.17
type +'a t = 'a node lazy_t
and +'a node =
| Nil
| Cons of 'a * 'a t
val empty : 'a t

Empty list.

val return : 'a -> 'a t

Return a computed value.

val is_empty : _ t -> bool

Evaluate the head.

val length : _ t -> int

length l returns the number of elements in l, eagerly (linear time). Caution, will not terminate if l is infinite.

val cons : 'a -> 'a t -> 'a t
val head : 'a t -> ('a * 'a t) option

Evaluate head, return it, or None if the list is empty.

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

Lazy map.

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

Filter values.

  • since 0.18
val take : int -> 'a t -> 'a t

Take at most n values.

  • since 0.18
val append : 'a t -> 'a t -> 'a t

Lazy concatenation.

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

Monadic flatten + map.

val default : default:'a t -> 'a t -> 'a t

Choice operator.

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

Alias to default.

  • since 2.1
type 'a gen = unit -> 'a option
val of_gen : 'a gen -> 'a t
val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list
val to_list_rev : 'a t -> 'a list
val to_gen : 'a t -> 'a gen
\ No newline at end of file +CCLazy_list (containers-data.CCLazy_list)

Module CCLazy_list

Lazy List

  • since 0.17
type +'a t = 'a node lazy_t
and +'a node =
| Nil
| Cons of 'a * 'a t
val empty : 'a t

Empty list.

val return : 'a -> 'a t

Return a computed value.

val is_empty : _ t -> bool

Evaluate the head.

val length : _ t -> int

length l returns the number of elements in l, eagerly (linear time). Caution, will not terminate if l is infinite.

val cons : 'a -> 'a t -> 'a t
val head : 'a t -> ('a * 'a t) option

Evaluate head, return it, or None if the list is empty.

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

Lazy map.

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

Filter values.

  • since 0.18
val take : int -> 'a t -> 'a t

Take at most n values.

  • since 0.18
val append : 'a t -> 'a t -> 'a t

Lazy concatenation.

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

Monadic flatten + map.

val default : default:'a t -> 'a t -> 'a t

Choice operator.

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

Alias to default.

  • since 2.1
type 'a gen = unit -> 'a option
val of_gen : 'a gen -> 'a t
val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list
val to_list_rev : 'a t -> 'a list
val to_gen : 'a t -> 'a gen
\ No newline at end of file diff --git a/dev/containers-data/CCMixmap/Make/argument-1-X/index.html b/dev/containers-data/CCMixmap/Make/argument-1-X/index.html index 8bd8f2d9..f00a1e0d 100644 --- a/dev/containers-data/CCMixmap/Make/argument-1-X/index.html +++ b/dev/containers-data/CCMixmap/Make/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCMixmap.Make.1-X)

Parameter Make.1-X

type t
val compare : t -> t -> int
\ No newline at end of file +X (containers-data.CCMixmap.Make.1-X)

Parameter Make.1-X

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCMixmap/Make/index.html b/dev/containers-data/CCMixmap/Make/index.html index d8f28c80..87c7812a 100644 --- a/dev/containers-data/CCMixmap/Make/index.html +++ b/dev/containers-data/CCMixmap/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCMixmap.Make)

Module CCMixmap.Make

Parameters

module X : ORD

Signature

type key = X.t
type t

A map containing values of different types, indexed by key.

val empty : t

Empty map.

val get : inj:'a injection -> key -> t -> 'a option

Get the value corresponding to this key, if it exists and belongs to the same key.

val add : inj:'a injection -> key -> 'a -> t -> t

Bind the key to the value, using inj.

val find : inj:'a injection -> key -> t -> 'a

Find the value for the given key, which must be of the right type.

  • raises Not_found

    if either the key is not found, or if its value doesn't belong to the right type.

val cardinal : t -> int

Number of bindings.

val remove : key -> t -> t

Remove the binding for this key.

val mem : inj:_ injection -> key -> t -> bool

Is the given key in the map, with the right type?

val iter_keys : f:( key -> unit ) -> t -> unit

Iterate on the keys of this map.

val fold_keys : f:( 'a -> key -> 'a ) -> x:'a -> t -> 'a

Fold over the keys.

Iterators

type 'a iter = ( 'a -> unit ) -> unit
val keys_iter : t -> key iter

All the keys.

val bindings_of : inj:'a injection -> t -> (key * 'a) iter

All the bindings that come from the corresponding injection.

type value =
| Value : ( 'a injection -> 'a option ) -> value
val bindings : t -> (key * value) iter

Iterate on all bindings.

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

Module CCMixmap.Make

Parameters

module X : ORD

Signature

type key = X.t
type t

A map containing values of different types, indexed by key.

val empty : t

Empty map.

val get : inj:'a injection -> key -> t -> 'a option

Get the value corresponding to this key, if it exists and belongs to the same key.

val add : inj:'a injection -> key -> 'a -> t -> t

Bind the key to the value, using inj.

val find : inj:'a injection -> key -> t -> 'a

Find the value for the given key, which must be of the right type.

  • raises Not_found

    if either the key is not found, or if its value doesn't belong to the right type.

val cardinal : t -> int

Number of bindings.

val remove : key -> t -> t

Remove the binding for this key.

val mem : inj:_ injection -> key -> t -> bool

Is the given key in the map, with the right type?

val iter_keys : f:( key -> unit ) -> t -> unit

Iterate on the keys of this map.

val fold_keys : f:( 'a -> key -> 'a ) -> x:'a -> t -> 'a

Fold over the keys.

Iterators

type 'a iter = ( 'a -> unit ) -> unit
val keys_iter : t -> key iter

All the keys.

val bindings_of : inj:'a injection -> t -> (key * 'a) iter

All the bindings that come from the corresponding injection.

type value =
| Value : ( 'a injection -> 'a option ) -> value
val bindings : t -> (key * value) iter

Iterate on all bindings.

\ No newline at end of file diff --git a/dev/containers-data/CCMixmap/index.html b/dev/containers-data/CCMixmap/index.html index 1478b339..81c83235 100644 --- a/dev/containers-data/CCMixmap/index.html +++ b/dev/containers-data/CCMixmap/index.html @@ -1,5 +1,5 @@ -CCMixmap (containers-data.CCMixmap)

Module CCMixmap

Maps with Heterogeneous Values

status: experimental

module M = CCMixmap.Make(CCInt)
+CCMixmap (containers-data.CCMixmap)

Module CCMixmap

Maps with Heterogeneous Values

status: experimental

module M = CCMixmap.Make(CCInt)
 
 let inj_int = CCMixmap.create_inj()
 let inj_str = CCMixmap.create_inj()
diff --git a/dev/containers-data/CCMixmap/module-type-ORD/index.html b/dev/containers-data/CCMixmap/module-type-ORD/index.html
index 8c472ced..85dd12e5 100644
--- a/dev/containers-data/CCMixmap/module-type-ORD/index.html
+++ b/dev/containers-data/CCMixmap/module-type-ORD/index.html
@@ -1,2 +1,2 @@
 
-ORD (containers-data.CCMixmap.ORD)

Module type CCMixmap.ORD

type t
val compare : t -> t -> int
\ No newline at end of file +ORD (containers-data.CCMixmap.ORD)

Module type CCMixmap.ORD

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCMixmap/module-type-S/index.html b/dev/containers-data/CCMixmap/module-type-S/index.html index db44f4dd..4981811b 100644 --- a/dev/containers-data/CCMixmap/module-type-S/index.html +++ b/dev/containers-data/CCMixmap/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCMixmap.S)

Module type CCMixmap.S

type key
type t

A map containing values of different types, indexed by key.

val empty : t

Empty map.

val get : inj:'a injection -> key -> t -> 'a option

Get the value corresponding to this key, if it exists and belongs to the same key.

val add : inj:'a injection -> key -> 'a -> t -> t

Bind the key to the value, using inj.

val find : inj:'a injection -> key -> t -> 'a

Find the value for the given key, which must be of the right type.

  • raises Not_found

    if either the key is not found, or if its value doesn't belong to the right type.

val cardinal : t -> int

Number of bindings.

val remove : key -> t -> t

Remove the binding for this key.

val mem : inj:_ injection -> key -> t -> bool

Is the given key in the map, with the right type?

val iter_keys : f:( key -> unit ) -> t -> unit

Iterate on the keys of this map.

val fold_keys : f:( 'a -> key -> 'a ) -> x:'a -> t -> 'a

Fold over the keys.

Iterators

type 'a iter = ( 'a -> unit ) -> unit
val keys_iter : t -> key iter

All the keys.

val bindings_of : inj:'a injection -> t -> (key * 'a) iter

All the bindings that come from the corresponding injection.

type value =
| Value : ( 'a injection -> 'a option ) -> value
val bindings : t -> (key * value) iter

Iterate on all bindings.

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

Module type CCMixmap.S

type key
type t

A map containing values of different types, indexed by key.

val empty : t

Empty map.

val get : inj:'a injection -> key -> t -> 'a option

Get the value corresponding to this key, if it exists and belongs to the same key.

val add : inj:'a injection -> key -> 'a -> t -> t

Bind the key to the value, using inj.

val find : inj:'a injection -> key -> t -> 'a

Find the value for the given key, which must be of the right type.

  • raises Not_found

    if either the key is not found, or if its value doesn't belong to the right type.

val cardinal : t -> int

Number of bindings.

val remove : key -> t -> t

Remove the binding for this key.

val mem : inj:_ injection -> key -> t -> bool

Is the given key in the map, with the right type?

val iter_keys : f:( key -> unit ) -> t -> unit

Iterate on the keys of this map.

val fold_keys : f:( 'a -> key -> 'a ) -> x:'a -> t -> 'a

Fold over the keys.

Iterators

type 'a iter = ( 'a -> unit ) -> unit
val keys_iter : t -> key iter

All the keys.

val bindings_of : inj:'a injection -> t -> (key * 'a) iter

All the bindings that come from the corresponding injection.

type value =
| Value : ( 'a injection -> 'a option ) -> value
val bindings : t -> (key * value) iter

Iterate on all bindings.

\ No newline at end of file diff --git a/dev/containers-data/CCMixset/index.html b/dev/containers-data/CCMixset/index.html index 55a82715..3666ef37 100644 --- a/dev/containers-data/CCMixset/index.html +++ b/dev/containers-data/CCMixset/index.html @@ -1,5 +1,5 @@ -CCMixset (containers-data.CCMixset)

Module CCMixset

Set of Heterogeneous Values

let k1 : int key = newkey () in
+CCMixset (containers-data.CCMixset)

Module CCMixset

Set of Heterogeneous Values

let k1 : int key = newkey () in
 let k2 : int key = newkey () in
 let k3 : string key = newkey () in
 let set =
diff --git a/dev/containers-data/CCMixtbl/index.html b/dev/containers-data/CCMixtbl/index.html
index b090a21c..46c97b13 100644
--- a/dev/containers-data/CCMixtbl/index.html
+++ b/dev/containers-data/CCMixtbl/index.html
@@ -1,5 +1,5 @@
 
-CCMixtbl (containers-data.CCMixtbl)

Module CCMixtbl

Hash Table with Heterogeneous Keys

From https://github.com/mjambon/mixtbl (thanks to him). Example:

let inj_int = CCMixtbl.create_inj () ;;
+CCMixtbl (containers-data.CCMixtbl)

Module CCMixtbl

Hash Table with Heterogeneous Keys

From https://github.com/mjambon/mixtbl (thanks to him). Example:

let inj_int = CCMixtbl.create_inj () ;;
 
 let tbl = CCMixtbl.create 10 ;;
 
diff --git a/dev/containers-data/CCMultiMap/Make/argument-1-K/index.html b/dev/containers-data/CCMultiMap/Make/argument-1-K/index.html
index d81da0b2..695b09f1 100644
--- a/dev/containers-data/CCMultiMap/Make/argument-1-K/index.html
+++ b/dev/containers-data/CCMultiMap/Make/argument-1-K/index.html
@@ -1,2 +1,2 @@
 
-K (containers-data.CCMultiMap.Make.1-K)

Parameter Make.1-K

type t
val compare : t -> t -> int
\ No newline at end of file +K (containers-data.CCMultiMap.Make.1-K)

Parameter Make.1-K

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/Make/argument-2-V/index.html b/dev/containers-data/CCMultiMap/Make/argument-2-V/index.html index fe317534..dfea939d 100644 --- a/dev/containers-data/CCMultiMap/Make/argument-2-V/index.html +++ b/dev/containers-data/CCMultiMap/Make/argument-2-V/index.html @@ -1,2 +1,2 @@ -V (containers-data.CCMultiMap.Make.2-V)

Parameter Make.2-V

type t
val compare : t -> t -> int
\ No newline at end of file +V (containers-data.CCMultiMap.Make.2-V)

Parameter Make.2-V

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/Make/index.html b/dev/containers-data/CCMultiMap/Make/index.html index e08fb3b7..7e7b915e 100644 --- a/dev/containers-data/CCMultiMap/Make/index.html +++ b/dev/containers-data/CCMultiMap/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCMultiMap.Make)

Module CCMultiMap.Make

Parameters

module K : OrderedType
module V : OrderedType

Signature

type key = K.t
type value = V.t
type t
val empty : t

Empty multimap.

val is_empty : t -> bool

Empty multimap?

val add : t -> key -> value -> t

Add a key/value binding.

val remove : t -> key -> value -> t

Remove the binding.

val remove_all : t -> key -> t

Remove the key from the map.

val mem : t -> key -> bool

Is there a binding for this key?

val find : t -> key -> value list

List of values for this key.

val find_iter : t -> key -> ( value -> unit ) -> unit

Iterate on bindings for this key.

val count : t -> key -> int

Number of bindings for this key.

val iter : t -> ( key -> value -> unit ) -> unit

Iterate on all key/value.

val fold : t -> 'a -> ( 'a -> key -> value -> 'a ) -> 'a

Fold on all key/value.

val size : t -> int

Number of keys.

val union : t -> t -> t

Union of multimaps.

val inter : t -> t -> t

Intersection of multimaps.

val diff : t -> t -> t

Difference of maps, i.e. bindings of the first that are not in the second.

val equal : t -> t -> bool

Same multimap.

val compare : t -> t -> int

Total order on multimaps.

val submap : t -> t -> bool

submap m1 m2 is true iff all bindings of m1 are also in m2.

val to_iter : t -> (key * value) iter
val of_iter : ?init:t -> (key * value) iter -> t
val keys : t -> key iter
val values : t -> value iter

Some values may occur several times.

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

Module CCMultiMap.Make

Parameters

module K : OrderedType
module V : OrderedType

Signature

type key = K.t
type value = V.t
type t
val empty : t

Empty multimap.

val is_empty : t -> bool

Empty multimap?

val add : t -> key -> value -> t

Add a key/value binding.

val remove : t -> key -> value -> t

Remove the binding.

val remove_all : t -> key -> t

Remove the key from the map.

val mem : t -> key -> bool

Is there a binding for this key?

val find : t -> key -> value list

List of values for this key.

val find_iter : t -> key -> ( value -> unit ) -> unit

Iterate on bindings for this key.

val count : t -> key -> int

Number of bindings for this key.

val iter : t -> ( key -> value -> unit ) -> unit

Iterate on all key/value.

val fold : t -> 'a -> ( 'a -> key -> value -> 'a ) -> 'a

Fold on all key/value.

val size : t -> int

Number of keys.

val union : t -> t -> t

Union of multimaps.

val inter : t -> t -> t

Intersection of multimaps.

val diff : t -> t -> t

Difference of maps, i.e. bindings of the first that are not in the second.

val equal : t -> t -> bool

Same multimap.

val compare : t -> t -> int

Total order on multimaps.

val submap : t -> t -> bool

submap m1 m2 is true iff all bindings of m1 are also in m2.

val to_iter : t -> (key * value) iter
val of_iter : ?init:t -> (key * value) iter -> t
val keys : t -> key iter
val values : t -> value iter

Some values may occur several times.

\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/MakeBidir/argument-1-L/index.html b/dev/containers-data/CCMultiMap/MakeBidir/argument-1-L/index.html index 19b0d01b..aaf310e5 100644 --- a/dev/containers-data/CCMultiMap/MakeBidir/argument-1-L/index.html +++ b/dev/containers-data/CCMultiMap/MakeBidir/argument-1-L/index.html @@ -1,2 +1,2 @@ -L (containers-data.CCMultiMap.MakeBidir.1-L)

Parameter MakeBidir.1-L

type t
val compare : t -> t -> int
\ No newline at end of file +L (containers-data.CCMultiMap.MakeBidir.1-L)

Parameter MakeBidir.1-L

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/MakeBidir/argument-2-R/index.html b/dev/containers-data/CCMultiMap/MakeBidir/argument-2-R/index.html index e8509a66..8d63bfab 100644 --- a/dev/containers-data/CCMultiMap/MakeBidir/argument-2-R/index.html +++ b/dev/containers-data/CCMultiMap/MakeBidir/argument-2-R/index.html @@ -1,2 +1,2 @@ -R (containers-data.CCMultiMap.MakeBidir.2-R)

Parameter MakeBidir.2-R

type t
val compare : t -> t -> int
\ No newline at end of file +R (containers-data.CCMultiMap.MakeBidir.2-R)

Parameter MakeBidir.2-R

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/MakeBidir/index.html b/dev/containers-data/CCMultiMap/MakeBidir/index.html index ff9a5e32..78fd1b9c 100644 --- a/dev/containers-data/CCMultiMap/MakeBidir/index.html +++ b/dev/containers-data/CCMultiMap/MakeBidir/index.html @@ -1,2 +1,2 @@ -MakeBidir (containers-data.CCMultiMap.MakeBidir)

Module CCMultiMap.MakeBidir

Parameters

module L : OrderedType
module R : OrderedType

Signature

type t
type left = L.t
type right = R.t
val empty : t
val is_empty : t -> bool
val add : t -> left -> right -> t

Add a binding (left,right).

val remove : t -> left -> right -> t

Remove a specific binding.

val cardinal_left : t -> int

Number of distinct left keys.

val cardinal_right : t -> int

Number of distinct right keys.

val remove_left : t -> left -> t

Remove all bindings for the left key.

val remove_right : t -> right -> t

Remove all bindings for the right key.

val mem_left : t -> left -> bool

Is the left key present in at least one pair?

val mem_right : t -> right -> bool

Is the right key present in at least one pair?

val find_left : t -> left -> right iter

Find all bindings for this given left-key.

val find_right : t -> right -> left iter

Find all bindings for this given right-key.

val find1_left : t -> left -> right option

Like find_left but returns at most one value.

val find1_right : t -> right -> left option

Like find_right but returns at most one value.

val fold : ( 'a -> left -> right -> 'a ) -> 'a -> t -> 'a

Fold on pairs.

val pairs : t -> (left * right) iter

Iterate on pairs.

val add_pairs : t -> (left * right) iter -> t

Add pairs.

val iter_left : t -> left iter
val iter_right : t -> right iter
\ No newline at end of file +MakeBidir (containers-data.CCMultiMap.MakeBidir)

Module CCMultiMap.MakeBidir

Parameters

module L : OrderedType
module R : OrderedType

Signature

type t
type left = L.t
type right = R.t
val empty : t
val is_empty : t -> bool
val add : t -> left -> right -> t

Add a binding (left,right).

val remove : t -> left -> right -> t

Remove a specific binding.

val cardinal_left : t -> int

Number of distinct left keys.

val cardinal_right : t -> int

Number of distinct right keys.

val remove_left : t -> left -> t

Remove all bindings for the left key.

val remove_right : t -> right -> t

Remove all bindings for the right key.

val mem_left : t -> left -> bool

Is the left key present in at least one pair?

val mem_right : t -> right -> bool

Is the right key present in at least one pair?

val find_left : t -> left -> right iter

Find all bindings for this given left-key.

val find_right : t -> right -> left iter

Find all bindings for this given right-key.

val find1_left : t -> left -> right option

Like find_left but returns at most one value.

val find1_right : t -> right -> left option

Like find_right but returns at most one value.

val fold : ( 'a -> left -> right -> 'a ) -> 'a -> t -> 'a

Fold on pairs.

val pairs : t -> (left * right) iter

Iterate on pairs.

val add_pairs : t -> (left * right) iter -> t

Add pairs.

val iter_left : t -> left iter
val iter_right : t -> right iter
\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/index.html b/dev/containers-data/CCMultiMap/index.html index 6aa12fcd..0a1646d2 100644 --- a/dev/containers-data/CCMultiMap/index.html +++ b/dev/containers-data/CCMultiMap/index.html @@ -1,5 +1,5 @@ -CCMultiMap (containers-data.CCMultiMap)

Module CCMultiMap

Map that can map key to several values

type 'a iter = ( 'a -> unit ) -> unit
module type S = sig ... end
module type OrderedType = sig ... end
module Make +CCMultiMap (containers-data.CCMultiMap)

Module CCMultiMap

Map that can map key to several values

type 'a iter = ( 'a -> unit ) -> unit
module type S = sig ... end
module type OrderedType = sig ... end
module Make (K : OrderedType) (V : OrderedType) : S with type key = K.t and type value = V.t

Two-Way Multimap

Represents n-to-n mappings between two types. Each element from the "left" is mapped to several right values, and conversely.

  • since 0.3.3
module type BIDIR = sig ... end
module MakeBidir diff --git a/dev/containers-data/CCMultiMap/module-type-BIDIR/index.html b/dev/containers-data/CCMultiMap/module-type-BIDIR/index.html index d7688dc0..b3c09954 100644 --- a/dev/containers-data/CCMultiMap/module-type-BIDIR/index.html +++ b/dev/containers-data/CCMultiMap/module-type-BIDIR/index.html @@ -1,2 +1,2 @@ -BIDIR (containers-data.CCMultiMap.BIDIR)

Module type CCMultiMap.BIDIR

type t
type left
type right
val empty : t
val is_empty : t -> bool
val add : t -> left -> right -> t

Add a binding (left,right).

val remove : t -> left -> right -> t

Remove a specific binding.

val cardinal_left : t -> int

Number of distinct left keys.

val cardinal_right : t -> int

Number of distinct right keys.

val remove_left : t -> left -> t

Remove all bindings for the left key.

val remove_right : t -> right -> t

Remove all bindings for the right key.

val mem_left : t -> left -> bool

Is the left key present in at least one pair?

val mem_right : t -> right -> bool

Is the right key present in at least one pair?

val find_left : t -> left -> right iter

Find all bindings for this given left-key.

val find_right : t -> right -> left iter

Find all bindings for this given right-key.

val find1_left : t -> left -> right option

Like find_left but returns at most one value.

val find1_right : t -> right -> left option

Like find_right but returns at most one value.

val fold : ( 'a -> left -> right -> 'a ) -> 'a -> t -> 'a

Fold on pairs.

val pairs : t -> (left * right) iter

Iterate on pairs.

val add_pairs : t -> (left * right) iter -> t

Add pairs.

val iter_left : t -> left iter
val iter_right : t -> right iter
\ No newline at end of file +BIDIR (containers-data.CCMultiMap.BIDIR)

Module type CCMultiMap.BIDIR

type t
type left
type right
val empty : t
val is_empty : t -> bool
val add : t -> left -> right -> t

Add a binding (left,right).

val remove : t -> left -> right -> t

Remove a specific binding.

val cardinal_left : t -> int

Number of distinct left keys.

val cardinal_right : t -> int

Number of distinct right keys.

val remove_left : t -> left -> t

Remove all bindings for the left key.

val remove_right : t -> right -> t

Remove all bindings for the right key.

val mem_left : t -> left -> bool

Is the left key present in at least one pair?

val mem_right : t -> right -> bool

Is the right key present in at least one pair?

val find_left : t -> left -> right iter

Find all bindings for this given left-key.

val find_right : t -> right -> left iter

Find all bindings for this given right-key.

val find1_left : t -> left -> right option

Like find_left but returns at most one value.

val find1_right : t -> right -> left option

Like find_right but returns at most one value.

val fold : ( 'a -> left -> right -> 'a ) -> 'a -> t -> 'a

Fold on pairs.

val pairs : t -> (left * right) iter

Iterate on pairs.

val add_pairs : t -> (left * right) iter -> t

Add pairs.

val iter_left : t -> left iter
val iter_right : t -> right iter
\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/module-type-OrderedType/index.html b/dev/containers-data/CCMultiMap/module-type-OrderedType/index.html index 1ac4228a..2971425d 100644 --- a/dev/containers-data/CCMultiMap/module-type-OrderedType/index.html +++ b/dev/containers-data/CCMultiMap/module-type-OrderedType/index.html @@ -1,2 +1,2 @@ -OrderedType (containers-data.CCMultiMap.OrderedType)

Module type CCMultiMap.OrderedType

type t
val compare : t -> t -> int
\ No newline at end of file +OrderedType (containers-data.CCMultiMap.OrderedType)

Module type CCMultiMap.OrderedType

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCMultiMap/module-type-S/index.html b/dev/containers-data/CCMultiMap/module-type-S/index.html index 3aa17e24..d2b14b48 100644 --- a/dev/containers-data/CCMultiMap/module-type-S/index.html +++ b/dev/containers-data/CCMultiMap/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCMultiMap.S)

Module type CCMultiMap.S

type key
type value
type t
val empty : t

Empty multimap.

val is_empty : t -> bool

Empty multimap?

val add : t -> key -> value -> t

Add a key/value binding.

val remove : t -> key -> value -> t

Remove the binding.

val remove_all : t -> key -> t

Remove the key from the map.

val mem : t -> key -> bool

Is there a binding for this key?

val find : t -> key -> value list

List of values for this key.

val find_iter : t -> key -> ( value -> unit ) -> unit

Iterate on bindings for this key.

val count : t -> key -> int

Number of bindings for this key.

val iter : t -> ( key -> value -> unit ) -> unit

Iterate on all key/value.

val fold : t -> 'a -> ( 'a -> key -> value -> 'a ) -> 'a

Fold on all key/value.

val size : t -> int

Number of keys.

val union : t -> t -> t

Union of multimaps.

val inter : t -> t -> t

Intersection of multimaps.

val diff : t -> t -> t

Difference of maps, i.e. bindings of the first that are not in the second.

val equal : t -> t -> bool

Same multimap.

val compare : t -> t -> int

Total order on multimaps.

val submap : t -> t -> bool

submap m1 m2 is true iff all bindings of m1 are also in m2.

val to_iter : t -> (key * value) iter
val of_iter : ?init:t -> (key * value) iter -> t
val keys : t -> key iter
val values : t -> value iter

Some values may occur several times.

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

Module type CCMultiMap.S

type key
type value
type t
val empty : t

Empty multimap.

val is_empty : t -> bool

Empty multimap?

val add : t -> key -> value -> t

Add a key/value binding.

val remove : t -> key -> value -> t

Remove the binding.

val remove_all : t -> key -> t

Remove the key from the map.

val mem : t -> key -> bool

Is there a binding for this key?

val find : t -> key -> value list

List of values for this key.

val find_iter : t -> key -> ( value -> unit ) -> unit

Iterate on bindings for this key.

val count : t -> key -> int

Number of bindings for this key.

val iter : t -> ( key -> value -> unit ) -> unit

Iterate on all key/value.

val fold : t -> 'a -> ( 'a -> key -> value -> 'a ) -> 'a

Fold on all key/value.

val size : t -> int

Number of keys.

val union : t -> t -> t

Union of multimaps.

val inter : t -> t -> t

Intersection of multimaps.

val diff : t -> t -> t

Difference of maps, i.e. bindings of the first that are not in the second.

val equal : t -> t -> bool

Same multimap.

val compare : t -> t -> int

Total order on multimaps.

val submap : t -> t -> bool

submap m1 m2 is true iff all bindings of m1 are also in m2.

val to_iter : t -> (key * value) iter
val of_iter : ?init:t -> (key * value) iter -> t
val keys : t -> key iter
val values : t -> value iter

Some values may occur several times.

\ No newline at end of file diff --git a/dev/containers-data/CCMultiSet/Make/index.html b/dev/containers-data/CCMultiSet/Make/index.html index b9772335..15a7e7f0 100644 --- a/dev/containers-data/CCMultiSet/Make/index.html +++ b/dev/containers-data/CCMultiSet/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCMultiSet.Make)

Module CCMultiSet.Make

Parameters

module O : Stdlib.Set.OrderedType

Signature

type elt = O.t
type t
val empty : t
val is_empty : t -> bool
val mem : t -> elt -> bool
val count : t -> elt -> int
val singleton : elt -> t
val add : t -> elt -> t
val remove : t -> elt -> t
val add_mult : t -> elt -> int -> t

add_mult set x n adds n occurrences of x to set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_mult : t -> elt -> int -> t

remove_mult set x n removes at most n occurrences of x from set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_all : t -> elt -> t

remove_all set x removes all occurrences of x from set.

  • since 0.22
val update : t -> elt -> ( int -> int ) -> t

update set x f calls f n where n is the current multiplicity of x in set (0 to indicate its absence); the result of f n is the new multiplicity of x.

  • raises Invalid_argument

    if f n < 0.

  • since 0.6
val min : t -> elt

Minimal element w.r.t the total ordering on elements.

val max : t -> elt

Maximal element w.r.t the total ordering on elements.

val union : t -> t -> t

union a b contains as many occurrences of an element x as count a x + count b x.

val meet : t -> t -> t

meet a b is a multiset such that count (meet a b) x = max (count a x) (count b x).

val intersection : t -> t -> t

intersection a b is a multiset such that count (intersection a b) x = min (count a x) (count b x).

val diff : t -> t -> t

MultiSet difference. count (diff a b) x = max (count a x - count b x) 0.

val contains : t -> t -> bool

contains a x = (count m x > 0).

val compare : t -> t -> int
val equal : t -> t -> bool
val cardinal : t -> int

Number of distinct elements.

val iter : t -> ( int -> elt -> unit ) -> unit
val fold : t -> 'b -> ( 'b -> int -> elt -> 'b ) -> 'b
val of_list : elt list -> t
val to_list : t -> elt list
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val of_list_mult : (elt * int) list -> t
  • since 0.19
val to_list_mult : t -> (elt * int) list
  • since 0.19
val to_iter_mult : t -> (elt * int) iter
  • since 0.19
val of_iter_mult : (elt * int) iter -> t
  • since 0.19
\ No newline at end of file +Make (containers-data.CCMultiSet.Make)

Module CCMultiSet.Make

Parameters

module O : Stdlib.Set.OrderedType

Signature

type elt = O.t
type t
val empty : t
val is_empty : t -> bool
val mem : t -> elt -> bool
val count : t -> elt -> int
val singleton : elt -> t
val add : t -> elt -> t
val remove : t -> elt -> t
val add_mult : t -> elt -> int -> t

add_mult set x n adds n occurrences of x to set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_mult : t -> elt -> int -> t

remove_mult set x n removes at most n occurrences of x from set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_all : t -> elt -> t

remove_all set x removes all occurrences of x from set.

  • since 0.22
val update : t -> elt -> ( int -> int ) -> t

update set x f calls f n where n is the current multiplicity of x in set (0 to indicate its absence); the result of f n is the new multiplicity of x.

  • raises Invalid_argument

    if f n < 0.

  • since 0.6
val min : t -> elt

Minimal element w.r.t the total ordering on elements.

val max : t -> elt

Maximal element w.r.t the total ordering on elements.

val union : t -> t -> t

union a b contains as many occurrences of an element x as count a x + count b x.

val meet : t -> t -> t

meet a b is a multiset such that count (meet a b) x = max (count a x) (count b x).

val intersection : t -> t -> t

intersection a b is a multiset such that count (intersection a b) x = min (count a x) (count b x).

val diff : t -> t -> t

MultiSet difference. count (diff a b) x = max (count a x - count b x) 0.

val contains : t -> t -> bool

contains a x = (count m x > 0).

val compare : t -> t -> int
val equal : t -> t -> bool
val cardinal : t -> int

Number of distinct elements.

val iter : t -> ( int -> elt -> unit ) -> unit
val fold : t -> 'b -> ( 'b -> int -> elt -> 'b ) -> 'b
val of_list : elt list -> t
val to_list : t -> elt list
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val of_list_mult : (elt * int) list -> t
  • since 0.19
val to_list_mult : t -> (elt * int) list
  • since 0.19
val to_iter_mult : t -> (elt * int) iter
  • since 0.19
val of_iter_mult : (elt * int) iter -> t
  • since 0.19
\ No newline at end of file diff --git a/dev/containers-data/CCMultiSet/index.html b/dev/containers-data/CCMultiSet/index.html index f55f2bbf..17660069 100644 --- a/dev/containers-data/CCMultiSet/index.html +++ b/dev/containers-data/CCMultiSet/index.html @@ -1,2 +1,2 @@ -CCMultiSet (containers-data.CCMultiSet)

Module CCMultiSet

Multiset

type 'a iter = ( 'a -> unit ) -> unit
module type S = sig ... end
module Make (O : Stdlib.Set.OrderedType) : S with type elt = O.t
\ No newline at end of file +CCMultiSet (containers-data.CCMultiSet)

Module CCMultiSet

Multiset

type 'a iter = ( 'a -> unit ) -> unit
module type S = sig ... end
module Make (O : Stdlib.Set.OrderedType) : S with type elt = O.t
\ No newline at end of file diff --git a/dev/containers-data/CCMultiSet/module-type-S/index.html b/dev/containers-data/CCMultiSet/module-type-S/index.html index 8e8fe1bc..8bba78e3 100644 --- a/dev/containers-data/CCMultiSet/module-type-S/index.html +++ b/dev/containers-data/CCMultiSet/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCMultiSet.S)

Module type CCMultiSet.S

type elt
type t
val empty : t
val is_empty : t -> bool
val mem : t -> elt -> bool
val count : t -> elt -> int
val singleton : elt -> t
val add : t -> elt -> t
val remove : t -> elt -> t
val add_mult : t -> elt -> int -> t

add_mult set x n adds n occurrences of x to set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_mult : t -> elt -> int -> t

remove_mult set x n removes at most n occurrences of x from set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_all : t -> elt -> t

remove_all set x removes all occurrences of x from set.

  • since 0.22
val update : t -> elt -> ( int -> int ) -> t

update set x f calls f n where n is the current multiplicity of x in set (0 to indicate its absence); the result of f n is the new multiplicity of x.

  • raises Invalid_argument

    if f n < 0.

  • since 0.6
val min : t -> elt

Minimal element w.r.t the total ordering on elements.

val max : t -> elt

Maximal element w.r.t the total ordering on elements.

val union : t -> t -> t

union a b contains as many occurrences of an element x as count a x + count b x.

val meet : t -> t -> t

meet a b is a multiset such that count (meet a b) x = max (count a x) (count b x).

val intersection : t -> t -> t

intersection a b is a multiset such that count (intersection a b) x = min (count a x) (count b x).

val diff : t -> t -> t

MultiSet difference. count (diff a b) x = max (count a x - count b x) 0.

val contains : t -> t -> bool

contains a x = (count m x > 0).

val compare : t -> t -> int
val equal : t -> t -> bool
val cardinal : t -> int

Number of distinct elements.

val iter : t -> ( int -> elt -> unit ) -> unit
val fold : t -> 'b -> ( 'b -> int -> elt -> 'b ) -> 'b
val of_list : elt list -> t
val to_list : t -> elt list
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val of_list_mult : (elt * int) list -> t
  • since 0.19
val to_list_mult : t -> (elt * int) list
  • since 0.19
val to_iter_mult : t -> (elt * int) iter
  • since 0.19
val of_iter_mult : (elt * int) iter -> t
  • since 0.19
\ No newline at end of file +S (containers-data.CCMultiSet.S)

Module type CCMultiSet.S

type elt
type t
val empty : t
val is_empty : t -> bool
val mem : t -> elt -> bool
val count : t -> elt -> int
val singleton : elt -> t
val add : t -> elt -> t
val remove : t -> elt -> t
val add_mult : t -> elt -> int -> t

add_mult set x n adds n occurrences of x to set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_mult : t -> elt -> int -> t

remove_mult set x n removes at most n occurrences of x from set.

  • raises Invalid_argument

    if n < 0.

  • since 0.6
val remove_all : t -> elt -> t

remove_all set x removes all occurrences of x from set.

  • since 0.22
val update : t -> elt -> ( int -> int ) -> t

update set x f calls f n where n is the current multiplicity of x in set (0 to indicate its absence); the result of f n is the new multiplicity of x.

  • raises Invalid_argument

    if f n < 0.

  • since 0.6
val min : t -> elt

Minimal element w.r.t the total ordering on elements.

val max : t -> elt

Maximal element w.r.t the total ordering on elements.

val union : t -> t -> t

union a b contains as many occurrences of an element x as count a x + count b x.

val meet : t -> t -> t

meet a b is a multiset such that count (meet a b) x = max (count a x) (count b x).

val intersection : t -> t -> t

intersection a b is a multiset such that count (intersection a b) x = min (count a x) (count b x).

val diff : t -> t -> t

MultiSet difference. count (diff a b) x = max (count a x - count b x) 0.

val contains : t -> t -> bool

contains a x = (count m x > 0).

val compare : t -> t -> int
val equal : t -> t -> bool
val cardinal : t -> int

Number of distinct elements.

val iter : t -> ( int -> elt -> unit ) -> unit
val fold : t -> 'b -> ( 'b -> int -> elt -> 'b ) -> 'b
val of_list : elt list -> t
val to_list : t -> elt list
val to_iter : t -> elt iter
val of_iter : elt iter -> t
val of_list_mult : (elt * int) list -> t
  • since 0.19
val to_list_mult : t -> (elt * int) list
  • since 0.19
val to_iter_mult : t -> (elt * int) iter
  • since 0.19
val of_iter_mult : (elt * int) iter -> t
  • since 0.19
\ No newline at end of file diff --git a/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html b/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html index 429c99f2..76fa090f 100644 --- a/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html +++ b/dev/containers-data/CCMutHeap/Make/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCMutHeap.Make.1-X)

Parameter Make.1-X

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Update index in heap

val lt : t -> t -> bool

cmp a b is true iff a < b

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

Parameter Make.1-X

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Update index in heap

val lt : t -> t -> bool

cmp a b is true iff a < b

\ No newline at end of file diff --git a/dev/containers-data/CCMutHeap/Make/index.html b/dev/containers-data/CCMutHeap/Make/index.html index b7e97cea..422e9467 100644 --- a/dev/containers-data/CCMutHeap/Make/index.html +++ b/dev/containers-data/CCMutHeap/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCMutHeap.Make)

Module CCMutHeap.Make

Parameters

module X : RANKED

Signature

type elt = X.t

Type of elements

type t

Heap of elt, whose priority is increased or decreased incrementally (see decrease for instance)

val create : unit -> t

Create a heap

val decrease : t -> elt -> unit

decrease h x decreases the value associated to x within h

val increase : t -> elt -> unit

increase h x increases the value associated to x within h

val in_heap : elt -> bool
val size : t -> int

Number of integers within the heap

val is_empty : t -> bool
val clear : t -> unit

Clear the content of the heap

val insert : t -> elt -> unit

Insert a new element into the heap

val remove_min : t -> elt

Remove and return the integer that has the lowest value from the heap

  • raises Not_found

    if the heap is empty

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

Filter out values that don't satisfy the predicate

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

Module CCMutHeap.Make

Parameters

module X : RANKED

Signature

type elt = X.t

Type of elements

type t

Heap of elt, whose priority is increased or decreased incrementally (see decrease for instance)

val create : unit -> t

Create a heap

val decrease : t -> elt -> unit

decrease h x decreases the value associated to x within h

val increase : t -> elt -> unit

increase h x increases the value associated to x within h

val in_heap : elt -> bool
val size : t -> int

Number of integers within the heap

val is_empty : t -> bool
val clear : t -> unit

Clear the content of the heap

val insert : t -> elt -> unit

Insert a new element into the heap

val remove_min : t -> elt

Remove and return the integer that has the lowest value from the heap

  • raises Not_found

    if the heap is empty

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

Filter out values that don't satisfy the predicate

\ No newline at end of file diff --git a/dev/containers-data/CCMutHeap/index.html b/dev/containers-data/CCMutHeap/index.html index 4764d666..4b151ea8 100644 --- a/dev/containers-data/CCMutHeap/index.html +++ b/dev/containers-data/CCMutHeap/index.html @@ -1,2 +1,2 @@ -CCMutHeap (containers-data.CCMutHeap)

Module CCMutHeap

Mutable Heaps

The classic binary heap in a vector.

STATUS: experimental, this might change in breaking ways.

  • since 3.1
module type RANKED = CCMutHeap_intf.RANKED
module type S = CCMutHeap_intf.S
module Make (X : RANKED) : S with type elt = X.t
\ No newline at end of file +CCMutHeap (containers-data.CCMutHeap)

Module CCMutHeap

Mutable Heaps

The classic binary heap in a vector.

STATUS: experimental, this might change in breaking ways.

  • since 3.1
module type RANKED = CCMutHeap_intf.RANKED
module type S = CCMutHeap_intf.S
module Make (X : RANKED) : S with type elt = X.t
\ No newline at end of file diff --git a/dev/containers-data/CCMutHeap_intf/index.html b/dev/containers-data/CCMutHeap_intf/index.html index 8e4e93a1..8e773a0b 100644 --- a/dev/containers-data/CCMutHeap_intf/index.html +++ b/dev/containers-data/CCMutHeap_intf/index.html @@ -1,2 +1,2 @@ -CCMutHeap_intf (containers-data.CCMutHeap_intf)

Module CCMutHeap_intf

Imperative Heaps

module type RANKED = sig ... end
module type S = sig ... end
\ No newline at end of file +CCMutHeap_intf (containers-data.CCMutHeap_intf)

Module CCMutHeap_intf

Imperative Heaps

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

Module type CCMutHeap_intf.RANKED

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Update index in heap

val lt : t -> t -> bool

cmp a b is true iff a < b

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

Module type CCMutHeap_intf.RANKED

type t
val idx : t -> int

Index in heap. return -1 if never set

val set_idx : t -> int -> unit

Update index in heap

val lt : t -> t -> bool

cmp a b is true iff a < b

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

Module type CCMutHeap_intf.S

type elt

Type of elements

type t

Heap of elt, whose priority is increased or decreased incrementally (see decrease for instance)

val create : unit -> t

Create a heap

val decrease : t -> elt -> unit

decrease h x decreases the value associated to x within h

val increase : t -> elt -> unit

increase h x increases the value associated to x within h

val in_heap : elt -> bool
val size : t -> int

Number of integers within the heap

val is_empty : t -> bool
val clear : t -> unit

Clear the content of the heap

val insert : t -> elt -> unit

Insert a new element into the heap

val remove_min : t -> elt

Remove and return the integer that has the lowest value from the heap

  • raises Not_found

    if the heap is empty

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

Filter out values that don't satisfy the predicate

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

Module type CCMutHeap_intf.S

type elt

Type of elements

type t

Heap of elt, whose priority is increased or decreased incrementally (see decrease for instance)

val create : unit -> t

Create a heap

val decrease : t -> elt -> unit

decrease h x decreases the value associated to x within h

val increase : t -> elt -> unit

increase h x increases the value associated to x within h

val in_heap : elt -> bool
val size : t -> int

Number of integers within the heap

val is_empty : t -> bool
val clear : t -> unit

Clear the content of the heap

val insert : t -> elt -> unit

Insert a new element into the heap

val remove_min : t -> elt

Remove and return the integer that has the lowest value from the heap

  • raises Not_found

    if the heap is empty

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

Filter out values that don't satisfy the predicate

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

Module CCPersistentArray

Persistent Arrays

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

  • since 0.10
type 'a t

The type of persistent arrays

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

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

  • raises Invalid_argument

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

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

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

  • raises Invalid_argument

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

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

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

  • raises Invalid_argument

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

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

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

  • raises Invalid_argument

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

val length : 'a t -> int

Return the length of the persistent array.

val copy : 'a t -> 'a t

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

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

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

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

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

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

Fold on the elements of the array.

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

Append the two arrays.

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

Concatenates all the sub-arrays.

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

Flat map (map + concatenation).

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

to_array t returns a mutable copy of t.

val of_array : 'a array -> 'a t

of_array a returns an immutable copy of a.

val to_list : 'a t -> 'a list

to_list t returns the list of elements in t.

val of_list : 'a list -> 'a t

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

val of_rev_list : 'a list -> 'a t

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

  • since 0.13

Conversions

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

IO

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

Module CCPersistentArray

Persistent Arrays

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

  • since 0.10
type 'a t

The type of persistent arrays

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

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

  • raises Invalid_argument

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

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

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

  • raises Invalid_argument

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

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

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

  • raises Invalid_argument

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

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

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

  • raises Invalid_argument

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

val length : 'a t -> int

Return the length of the persistent array.

val copy : 'a t -> 'a t

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

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

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

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

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

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

Fold on the elements of the array.

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

Append the two arrays.

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

Concatenates all the sub-arrays.

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

Flat map (map + concatenation).

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

to_array t returns a mutable copy of t.

val of_array : 'a array -> 'a t

of_array a returns an immutable copy of a.

val to_list : 'a t -> 'a list

to_list t returns the list of elements in t.

val of_list : 'a list -> 'a t

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

val of_rev_list : 'a list -> 'a t

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

  • since 0.13

Conversions

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

IO

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : 'a printer -> 'a t printer
  • since 0.13
\ No newline at end of file diff --git a/dev/containers-data/CCPersistentHashtbl/Make/argument-1-H/index.html b/dev/containers-data/CCPersistentHashtbl/Make/argument-1-H/index.html index 0ad6c98d..e0cbdf7f 100644 --- a/dev/containers-data/CCPersistentHashtbl/Make/argument-1-H/index.html +++ b/dev/containers-data/CCPersistentHashtbl/Make/argument-1-H/index.html @@ -1,2 +1,2 @@ -H (containers-data.CCPersistentHashtbl.Make.1-H)

Parameter Make.1-H

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file +H (containers-data.CCPersistentHashtbl.Make.1-H)

Parameter Make.1-H

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCPersistentHashtbl/Make/index.html b/dev/containers-data/CCPersistentHashtbl/Make/index.html index d6281c58..e2dab6d9 100644 --- a/dev/containers-data/CCPersistentHashtbl/Make/index.html +++ b/dev/containers-data/CCPersistentHashtbl/Make/index.html @@ -1,5 +1,5 @@ -Make (containers-data.CCPersistentHashtbl.Make)

Module CCPersistentHashtbl.Make

Parameters

module H : HashedType

Signature

type key = H.t
type 'a t
val empty : unit -> 'a t

Empty table. The table will be allocated at the first binding.

val create : int -> 'a t

Create a new hashtable, with the given initial capacity.

val is_empty : 'a t -> bool

Is the table empty?

val find : 'a t -> key -> 'a

Find the value for this key, or fails.

  • raises Not_found

    if the key is not present in the table.

val get_exn : key -> 'a t -> 'a

Synonym to find with flipped arguments.

val get : key -> 'a t -> 'a option

Safe version of get_exn.

val mem : 'a t -> key -> bool

Is the key bound?

val length : _ t -> int

Number of bindings.

val add : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. The old binding for this key, if it exists, is shadowed and will be restored upon remove tbl k.

  • since 0.14
val replace : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. This erases the current binding for key, if any.

val update : 'a t -> key -> ( 'a option -> 'a option ) -> 'a t

update tbl key f calls f None if key doesn't belong in tbl, f (Some v) if key -> v otherwise; If f returns None then key is removed, else it returns Some v' and key -> v' is added.

val remove : 'a t -> key -> 'a t

Remove the key.

val copy : 'a t -> 'a t

Fresh copy of the table; the underlying structure is not shared anymore, so using both tables alternatively will be efficient.

val merge : +Make (containers-data.CCPersistentHashtbl.Make)

Module CCPersistentHashtbl.Make

Parameters

module H : HashedType

Signature

type key = H.t
type 'a t
val empty : unit -> 'a t

Empty table. The table will be allocated at the first binding.

val create : int -> 'a t

Create a new hashtable, with the given initial capacity.

val is_empty : 'a t -> bool

Is the table empty?

val find : 'a t -> key -> 'a

Find the value for this key, or fails.

  • raises Not_found

    if the key is not present in the table.

val get_exn : key -> 'a t -> 'a

Synonym to find with flipped arguments.

val get : key -> 'a t -> 'a option

Safe version of get_exn.

val mem : 'a t -> key -> bool

Is the key bound?

val length : _ t -> int

Number of bindings.

val add : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. The old binding for this key, if it exists, is shadowed and will be restored upon remove tbl k.

  • since 0.14
val replace : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. This erases the current binding for key, if any.

val update : 'a t -> key -> ( 'a option -> 'a option ) -> 'a t

update tbl key f calls f None if key doesn't belong in tbl, f (Some v) if key -> v otherwise; If f returns None then key is removed, else it returns Some v' and key -> v' is added.

val remove : 'a t -> key -> 'a t

Remove the key.

val copy : 'a t -> 'a t

Fresh copy of the table; the underlying structure is not shared anymore, so using both tables alternatively will be efficient.

val merge : f:( key -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers-data/CCPersistentHashtbl/index.html b/dev/containers-data/CCPersistentHashtbl/index.html index 9ad0c70a..d7cb969b 100644 --- a/dev/containers-data/CCPersistentHashtbl/index.html +++ b/dev/containers-data/CCPersistentHashtbl/index.html @@ -1,2 +1,2 @@ -CCPersistentHashtbl (containers-data.CCPersistentHashtbl)

Module CCPersistentHashtbl

Persistent hash-table on top of OCaml's hashtables

Almost as efficient as the regular Hashtbl type, but with a persistent interface (rewinding changes to get back in the past history). This is mostly useful for backtracking-like uses, or forward uses (never using old values).

This module is not thread-safe.

type 'a iter = ( 'a -> unit ) -> unit
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a equal = 'a -> 'a -> bool
module type HashedType = sig ... end

Signature of such a hashtable

module type S = sig ... end

Implementation

module Make (H : HashedType) : S with type key = H.t
\ No newline at end of file +CCPersistentHashtbl (containers-data.CCPersistentHashtbl)

Module CCPersistentHashtbl

Persistent hash-table on top of OCaml's hashtables

Almost as efficient as the regular Hashtbl type, but with a persistent interface (rewinding changes to get back in the past history). This is mostly useful for backtracking-like uses, or forward uses (never using old values).

This module is not thread-safe.

type 'a iter = ( 'a -> unit ) -> unit
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a equal = 'a -> 'a -> bool
module type HashedType = sig ... end

Signature of such a hashtable

module type S = sig ... end

Implementation

module Make (H : HashedType) : S with type key = H.t
\ No newline at end of file diff --git a/dev/containers-data/CCPersistentHashtbl/module-type-HashedType/index.html b/dev/containers-data/CCPersistentHashtbl/module-type-HashedType/index.html index bca3880e..ce61d9b5 100644 --- a/dev/containers-data/CCPersistentHashtbl/module-type-HashedType/index.html +++ b/dev/containers-data/CCPersistentHashtbl/module-type-HashedType/index.html @@ -1,2 +1,2 @@ -HashedType (containers-data.CCPersistentHashtbl.HashedType)

Module type CCPersistentHashtbl.HashedType

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file +HashedType (containers-data.CCPersistentHashtbl.HashedType)

Module type CCPersistentHashtbl.HashedType

type t
val equal : t -> t -> bool
val hash : t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCPersistentHashtbl/module-type-S/index.html b/dev/containers-data/CCPersistentHashtbl/module-type-S/index.html index 5eef96e0..4db3ccfd 100644 --- a/dev/containers-data/CCPersistentHashtbl/module-type-S/index.html +++ b/dev/containers-data/CCPersistentHashtbl/module-type-S/index.html @@ -1,5 +1,5 @@ -S (containers-data.CCPersistentHashtbl.S)

Module type CCPersistentHashtbl.S

type key
type 'a t
val empty : unit -> 'a t

Empty table. The table will be allocated at the first binding.

val create : int -> 'a t

Create a new hashtable, with the given initial capacity.

val is_empty : 'a t -> bool

Is the table empty?

val find : 'a t -> key -> 'a

Find the value for this key, or fails.

  • raises Not_found

    if the key is not present in the table.

val get_exn : key -> 'a t -> 'a

Synonym to find with flipped arguments.

val get : key -> 'a t -> 'a option

Safe version of get_exn.

val mem : 'a t -> key -> bool

Is the key bound?

val length : _ t -> int

Number of bindings.

val add : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. The old binding for this key, if it exists, is shadowed and will be restored upon remove tbl k.

  • since 0.14
val replace : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. This erases the current binding for key, if any.

val update : 'a t -> key -> ( 'a option -> 'a option ) -> 'a t

update tbl key f calls f None if key doesn't belong in tbl, f (Some v) if key -> v otherwise; If f returns None then key is removed, else it returns Some v' and key -> v' is added.

val remove : 'a t -> key -> 'a t

Remove the key.

val copy : 'a t -> 'a t

Fresh copy of the table; the underlying structure is not shared anymore, so using both tables alternatively will be efficient.

val merge : +S (containers-data.CCPersistentHashtbl.S)

Module type CCPersistentHashtbl.S

type key
type 'a t
val empty : unit -> 'a t

Empty table. The table will be allocated at the first binding.

val create : int -> 'a t

Create a new hashtable, with the given initial capacity.

val is_empty : 'a t -> bool

Is the table empty?

val find : 'a t -> key -> 'a

Find the value for this key, or fails.

  • raises Not_found

    if the key is not present in the table.

val get_exn : key -> 'a t -> 'a

Synonym to find with flipped arguments.

val get : key -> 'a t -> 'a option

Safe version of get_exn.

val mem : 'a t -> key -> bool

Is the key bound?

val length : _ t -> int

Number of bindings.

val add : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. The old binding for this key, if it exists, is shadowed and will be restored upon remove tbl k.

  • since 0.14
val replace : 'a t -> key -> 'a -> 'a t

Add the binding to the table, returning a new table. This erases the current binding for key, if any.

val update : 'a t -> key -> ( 'a option -> 'a option ) -> 'a t

update tbl key f calls f None if key doesn't belong in tbl, f (Some v) if key -> v otherwise; If f returns None then key is removed, else it returns Some v' and key -> v' is added.

val remove : 'a t -> key -> 'a t

Remove the key.

val copy : 'a t -> 'a t

Fresh copy of the table; the underlying structure is not shared anymore, so using both tables alternatively will be efficient.

val merge : f:( key -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers-data/CCRAL/Infix/index.html b/dev/containers-data/CCRAL/Infix/index.html index 545d3da9..c17fa2e4 100644 --- a/dev/containers-data/CCRAL/Infix/index.html +++ b/dev/containers-data/CCRAL/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers-data.CCRAL.Infix)

Module CCRAL.Infix

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

Cons (alias to cons).

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

Alias to flat_map.

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

Alias to map.

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

Alias to app.

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

Alias to range.

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

a --^ b is the integer range from a to b, where b is excluded.

  • since 0.17
\ No newline at end of file +Infix (containers-data.CCRAL.Infix)

Module CCRAL.Infix

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

Cons (alias to cons).

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

Alias to flat_map.

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

Alias to map.

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

Alias to app.

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

Alias to range.

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

a --^ b is the integer range from a to b, where b is excluded.

  • since 0.17
\ No newline at end of file diff --git a/dev/containers-data/CCRAL/index.html b/dev/containers-data/CCRAL/index.html index eaca80dd..f0f1fdab 100644 --- a/dev/containers-data/CCRAL/index.html +++ b/dev/containers-data/CCRAL/index.html @@ -1,2 +1,2 @@ -CCRAL (containers-data.CCRAL)

Module CCRAL

Random-Access Lists

This is an OCaml implementation of Okasaki's paper "Purely Functional Random Access Lists". It defines a list-like data structure with O(1) cons/tail operations, and O(log(n)) lookup/modification operations.

This module used to be part of containers.misc

status: stable

  • since 0.13
type +'a t

List containing elements of type 'a

val empty : 'a t

Empty list.

val is_empty : _ t -> bool

Check whether the list is empty.

val cons : 'a -> 'a t -> 'a t

Add an element at the front of the list.

val return : 'a -> 'a t

Singleton.

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

Map on elements.

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

Map with index.

val hd : 'a t -> 'a

First element of the list, or

  • raises Invalid_argument

    if the list is empty.

val tl : 'a t -> 'a t

Remove the first element from the list, or

  • raises Invalid_argument

    if the list is empty.

val front : 'a t -> ('a * 'a t) option

Remove and return the first element of the list.

val front_exn : 'a t -> 'a * 'a t

Unsafe version of front.

  • raises Invalid_argument

    if the list is empty.

val length : 'a t -> int

Number of elements. Complexity O(ln n) where n=number of elements.

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

get l i accesses the i-th element of the list. O(log(n)).

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

Unsafe version of get.

  • raises Invalid_argument

    if the list has less than i+1 elements.

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

set l i v sets the i-th element of the list to v. O(log(n)).

  • raises Invalid_argument

    if the list has less than i+1 elements.

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

remove l i removes the i-th element of l.

  • raises Invalid_argument

    if the list has less than i+1 elements.

val get_and_remove_exn : 'a t -> int -> 'a * 'a t

get_and_remove_exn l i accesses and removes the i-th element of l.

  • raises Invalid_argument

    if the list has less than i+1 elements.

val append : 'a t -> 'a t -> 'a t
val filter : f:( 'a -> bool ) -> 'a t -> 'a t
val filter_map : f:( 'a -> 'b option ) -> 'a t -> 'b t
val flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t
val flatten : 'a t t -> 'a t
val app : ( 'a -> 'b ) t -> 'a t -> 'b t
val take : int -> 'a t -> 'a t
val take_while : f:( 'a -> bool ) -> 'a t -> 'a t
val drop : int -> 'a t -> 'a t
val drop_while : f:( 'a -> bool ) -> 'a t -> 'a t
val take_drop : int -> 'a t -> 'a t * 'a t

take_drop n l splits l into a, b such that length a = n if length l >= n, and such that append a b = l.

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

Iterate on the list's elements.

val iteri : f:( int -> 'a -> unit ) -> 'a t -> unit
val fold : f:( 'b -> 'a -> 'b ) -> x:'b -> 'a t -> 'b

Fold on the list's elements.

val fold_rev : f:( 'b -> 'a -> 'b ) -> x:'b -> 'a t -> 'b

Fold on the list's elements, in reverse order (starting from the tail).

val rev_map : f:( 'a -> 'b ) -> 'a t -> 'b t

rev_map f l is the same as map f (rev l).

val rev : 'a t -> 'a t

Reverse the list.

val equal : eq:( 'a -> 'a -> bool ) -> 'a t -> 'a t -> bool
val compare : cmp:( 'a -> 'a -> int ) -> 'a t -> 'a t -> int

Lexicographic comparison.

Utils

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

repeat n l is append l (append l ... l) n times.

val range : int -> int -> int t

range i j is i; i+1; ... ; j or j; j-1; ...; i.

Conversions

type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
val add_list : 'a t -> 'a list -> 'a t
val of_list : 'a list -> 'a t

Convert a list to a RAL. Caution: non tail-rec.

val to_list : 'a t -> 'a list
val of_list_map : f:( 'a -> 'b ) -> 'a list -> 'b t

Combination of of_list and map.

val of_array : 'a array -> 'a t
val add_array : 'a t -> 'a array -> 'a t
val to_array : 'a t -> 'a array

More efficient than on usual lists.

val add_iter : 'a t -> 'a iter -> 'a t
val of_iter : 'a iter -> 'a t
val to_iter : 'a t -> 'a iter
val add_gen : 'a t -> 'a gen -> 'a t
val of_gen : 'a gen -> 'a t
val to_gen : 'a t -> 'a gen

Infix

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

Cons (alias to cons).

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

Alias to flat_map.

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

Alias to map.

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

Alias to app.

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

Alias to range.

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

a --^ b is the integer range from a to b, where b is excluded.

  • since 0.17

IO

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

Module CCRAL

Random-Access Lists

This is an OCaml implementation of Okasaki's paper "Purely Functional Random Access Lists". It defines a list-like data structure with O(1) cons/tail operations, and O(log(n)) lookup/modification operations.

This module used to be part of containers.misc

status: stable

  • since 0.13
type +'a t

List containing elements of type 'a

val empty : 'a t

Empty list.

val is_empty : _ t -> bool

Check whether the list is empty.

val cons : 'a -> 'a t -> 'a t

Add an element at the front of the list.

val return : 'a -> 'a t

Singleton.

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

Map on elements.

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

Map with index.

val hd : 'a t -> 'a

First element of the list, or

  • raises Invalid_argument

    if the list is empty.

val tl : 'a t -> 'a t

Remove the first element from the list, or

  • raises Invalid_argument

    if the list is empty.

val front : 'a t -> ('a * 'a t) option

Remove and return the first element of the list.

val front_exn : 'a t -> 'a * 'a t

Unsafe version of front.

  • raises Invalid_argument

    if the list is empty.

val length : 'a t -> int

Number of elements. Complexity O(ln n) where n=number of elements.

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

get l i accesses the i-th element of the list. O(log(n)).

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

Unsafe version of get.

  • raises Invalid_argument

    if the list has less than i+1 elements.

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

set l i v sets the i-th element of the list to v. O(log(n)).

  • raises Invalid_argument

    if the list has less than i+1 elements.

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

remove l i removes the i-th element of l.

  • raises Invalid_argument

    if the list has less than i+1 elements.

val get_and_remove_exn : 'a t -> int -> 'a * 'a t

get_and_remove_exn l i accesses and removes the i-th element of l.

  • raises Invalid_argument

    if the list has less than i+1 elements.

val append : 'a t -> 'a t -> 'a t
val filter : f:( 'a -> bool ) -> 'a t -> 'a t
val filter_map : f:( 'a -> 'b option ) -> 'a t -> 'b t
val flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t
val flatten : 'a t t -> 'a t
val app : ( 'a -> 'b ) t -> 'a t -> 'b t
val take : int -> 'a t -> 'a t
val take_while : f:( 'a -> bool ) -> 'a t -> 'a t
val drop : int -> 'a t -> 'a t
val drop_while : f:( 'a -> bool ) -> 'a t -> 'a t
val take_drop : int -> 'a t -> 'a t * 'a t

take_drop n l splits l into a, b such that length a = n if length l >= n, and such that append a b = l.

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

Iterate on the list's elements.

val iteri : f:( int -> 'a -> unit ) -> 'a t -> unit
val fold : f:( 'b -> 'a -> 'b ) -> x:'b -> 'a t -> 'b

Fold on the list's elements.

val fold_rev : f:( 'b -> 'a -> 'b ) -> x:'b -> 'a t -> 'b

Fold on the list's elements, in reverse order (starting from the tail).

val rev_map : f:( 'a -> 'b ) -> 'a t -> 'b t

rev_map f l is the same as map f (rev l).

val rev : 'a t -> 'a t

Reverse the list.

val equal : eq:( 'a -> 'a -> bool ) -> 'a t -> 'a t -> bool
val compare : cmp:( 'a -> 'a -> int ) -> 'a t -> 'a t -> int

Lexicographic comparison.

Utils

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

repeat n l is append l (append l ... l) n times.

val range : int -> int -> int t

range i j is i; i+1; ... ; j or j; j-1; ...; i.

Conversions

type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
val add_list : 'a t -> 'a list -> 'a t
val of_list : 'a list -> 'a t

Convert a list to a RAL. Caution: non tail-rec.

val to_list : 'a t -> 'a list
val of_list_map : f:( 'a -> 'b ) -> 'a list -> 'b t

Combination of of_list and map.

val of_array : 'a array -> 'a t
val add_array : 'a t -> 'a array -> 'a t
val to_array : 'a t -> 'a array

More efficient than on usual lists.

val add_iter : 'a t -> 'a iter -> 'a t
val of_iter : 'a iter -> 'a t
val to_iter : 'a t -> 'a iter
val add_gen : 'a t -> 'a gen -> 'a t
val of_gen : 'a gen -> 'a t
val to_gen : 'a t -> 'a gen

Infix

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

Cons (alias to cons).

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

Alias to flat_map.

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

Alias to map.

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

Alias to app.

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

Alias to range.

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

a --^ b is the integer range from a to b, where b is excluded.

  • since 0.17

IO

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : ?pp_sep:unit printer -> 'a printer -> 'a t printer
\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Array/Byte/index.html b/dev/containers-data/CCRingBuffer/Array/Byte/index.html index 4d294348..267747ea 100644 --- a/dev/containers-data/CCRingBuffer/Array/Byte/index.html +++ b/dev/containers-data/CCRingBuffer/Array/Byte/index.html @@ -1,2 +1,2 @@ -Byte (containers-data.CCRingBuffer.Array.Byte)

Module Array.Byte

Efficient array version for the char type

type elt = char

The element type

type t = Stdlib.Bytes.t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file +Byte (containers-data.CCRingBuffer.Array.Byte)

Module Array.Byte

Efficient array version for the char type

type elt = char

The element type

type t = Stdlib.Bytes.t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Array/Make/argument-1-Elt/index.html b/dev/containers-data/CCRingBuffer/Array/Make/argument-1-Elt/index.html index e25de7fc..ee038525 100644 --- a/dev/containers-data/CCRingBuffer/Array/Make/argument-1-Elt/index.html +++ b/dev/containers-data/CCRingBuffer/Array/Make/argument-1-Elt/index.html @@ -1,2 +1,2 @@ -Elt (containers-data.CCRingBuffer.Array.Make.1-Elt)

Parameter Make.1-Elt

type t
val dummy : t
\ No newline at end of file +Elt (containers-data.CCRingBuffer.Array.Make.1-Elt)

Parameter Make.1-Elt

type t
val dummy : t
\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Array/Make/index.html b/dev/containers-data/CCRingBuffer/Array/Make/index.html index 53f9a154..1099acb4 100644 --- a/dev/containers-data/CCRingBuffer/Array/Make/index.html +++ b/dev/containers-data/CCRingBuffer/Array/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCRingBuffer.Array.Make)

Module Array.Make

Makes an array given an arbitrary element type

Parameters

module Elt : sig ... end

Signature

type elt = Elt.t

The element type

type t = Elt.t array

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file +Make (containers-data.CCRingBuffer.Array.Make)

Module Array.Make

Makes an array given an arbitrary element type

Parameters

module Elt : sig ... end

Signature

type elt = Elt.t

The element type

type t = Elt.t array

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Array/index.html b/dev/containers-data/CCRingBuffer/Array/index.html index aefbddad..0450116b 100644 --- a/dev/containers-data/CCRingBuffer/Array/index.html +++ b/dev/containers-data/CCRingBuffer/Array/index.html @@ -1,4 +1,4 @@ -Array (containers-data.CCRingBuffer.Array)

Module CCRingBuffer.Array

The abstract type for arrays

module type S = sig ... end
module Byte : S with type elt = char and type t = Stdlib.Bytes.t

Efficient array version for the char type

module Make +Array (containers-data.CCRingBuffer.Array)

Module CCRingBuffer.Array

The abstract type for arrays

module type S = sig ... end
module Byte : S with type elt = char and type t = Stdlib.Bytes.t

Efficient array version for the char type

module Make (Elt : sig ... end) : S with type elt = Elt.t and type t = Elt.t array

Makes an array given an arbitrary element type

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Array/module-type-S/index.html b/dev/containers-data/CCRingBuffer/Array/module-type-S/index.html index 901de18f..7fca6df8 100644 --- a/dev/containers-data/CCRingBuffer/Array/module-type-S/index.html +++ b/dev/containers-data/CCRingBuffer/Array/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCRingBuffer.Array.S)

Module type Array.S

type elt

The element type

type t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file +S (containers-data.CCRingBuffer.Array.S)

Module type Array.S

type elt

The element type

type t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Byte/index.html b/dev/containers-data/CCRingBuffer/Byte/index.html index 61c6f76e..a630e9cc 100644 --- a/dev/containers-data/CCRingBuffer/Byte/index.html +++ b/dev/containers-data/CCRingBuffer/Byte/index.html @@ -1,2 +1,2 @@ -Byte (containers-data.CCRingBuffer.Byte)

Module CCRingBuffer.Byte

An efficient byte based ring buffer

module Array = Array.Byte

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file +Byte (containers-data.CCRingBuffer.Byte)

Module CCRingBuffer.Byte

An efficient byte based ring buffer

module Array = Array.Byte

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Make/Array/index.html b/dev/containers-data/CCRingBuffer/Make/Array/index.html index 07f29914..39f66c9c 100644 --- a/dev/containers-data/CCRingBuffer/Make/Array/index.html +++ b/dev/containers-data/CCRingBuffer/Make/Array/index.html @@ -1,2 +1,2 @@ -Array (containers-data.CCRingBuffer.Make.Array)

Module Make.Array

The module type of Array for this ring buffer

type elt = X.t

The element type

type t = X.t array

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file +Array (containers-data.CCRingBuffer.Make.Array)

Module Make.Array

The module type of Array for this ring buffer

type elt = X.t

The element type

type t = X.t array

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Make/argument-1-X/index.html b/dev/containers-data/CCRingBuffer/Make/argument-1-X/index.html index 671817ca..334d8feb 100644 --- a/dev/containers-data/CCRingBuffer/Make/argument-1-X/index.html +++ b/dev/containers-data/CCRingBuffer/Make/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCRingBuffer.Make.1-X)

Parameter Make.1-X

type t
val dummy : t
\ No newline at end of file +X (containers-data.CCRingBuffer.Make.1-X)

Parameter Make.1-X

type t
val dummy : t
\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/Make/index.html b/dev/containers-data/CCRingBuffer/Make/index.html index 6c33503c..a7422f4a 100644 --- a/dev/containers-data/CCRingBuffer/Make/index.html +++ b/dev/containers-data/CCRingBuffer/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCRingBuffer.Make)

Module CCRingBuffer.Make

Buffer using regular arrays

Parameters

module X : sig ... end

Signature

module Array : Array.S with type elt = X.t with type t = X.t array

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file +Make (containers-data.CCRingBuffer.Make)

Module CCRingBuffer.Make

Buffer using regular arrays

Parameters

module X : sig ... end

Signature

module Array : Array.S with type elt = X.t with type t = X.t array

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/MakeFromArray/argument-1-A/index.html b/dev/containers-data/CCRingBuffer/MakeFromArray/argument-1-A/index.html index 6210e9c1..21f036fe 100644 --- a/dev/containers-data/CCRingBuffer/MakeFromArray/argument-1-A/index.html +++ b/dev/containers-data/CCRingBuffer/MakeFromArray/argument-1-A/index.html @@ -1,2 +1,2 @@ -A (containers-data.CCRingBuffer.MakeFromArray.1-A)

Parameter MakeFromArray.1-A

type elt

The element type

type t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file +A (containers-data.CCRingBuffer.MakeFromArray.1-A)

Parameter MakeFromArray.1-A

type elt

The element type

type t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/MakeFromArray/index.html b/dev/containers-data/CCRingBuffer/MakeFromArray/index.html index 20e63b81..c3fe5605 100644 --- a/dev/containers-data/CCRingBuffer/MakeFromArray/index.html +++ b/dev/containers-data/CCRingBuffer/MakeFromArray/index.html @@ -1,2 +1,2 @@ -MakeFromArray (containers-data.CCRingBuffer.MakeFromArray)

Module CCRingBuffer.MakeFromArray

Makes a ring buffer module with the given array type

Parameters

module A : Array.S

Signature

module Array = A

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file +MakeFromArray (containers-data.CCRingBuffer.MakeFromArray)

Module CCRingBuffer.MakeFromArray

Makes a ring buffer module with the given array type

Parameters

module A : Array.S

Signature

module Array = A

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/index.html b/dev/containers-data/CCRingBuffer/index.html index 57842b6b..2b115463 100644 --- a/dev/containers-data/CCRingBuffer/index.html +++ b/dev/containers-data/CCRingBuffer/index.html @@ -1,4 +1,4 @@ -CCRingBuffer (containers-data.CCRingBuffer)

Module CCRingBuffer

Circular Buffer (Deque)

Useful for IO, or as a bounded-size alternative to Queue when batch operations are needed.

status: experimental

Change in the API to provide only a bounded buffer since 1.3

  • since 0.9

Underlying Array

module Array : sig ... end

The abstract type for arrays

module type S = sig ... end
module Byte : S with module Array = Array.Byte

An efficient byte based ring buffer

module MakeFromArray (A : Array.S) : S with module Array = A

Makes a ring buffer module with the given array type

module Make +CCRingBuffer (containers-data.CCRingBuffer)

Module CCRingBuffer

Circular Buffer (Deque)

Useful for IO, or as a bounded-size alternative to Queue when batch operations are needed.

status: experimental

Change in the API to provide only a bounded buffer since 1.3

  • since 0.9

Underlying Array

module Array : sig ... end

The abstract type for arrays

module type S = sig ... end
module Byte : S with module Array = Array.Byte

An efficient byte based ring buffer

module MakeFromArray (A : Array.S) : S with module Array = A

Makes a ring buffer module with the given array type

module Make (X : sig ... end) : S with type Array.elt = X.t and type Array.t = X.t array

Buffer using regular arrays

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/module-type-S/Array/index.html b/dev/containers-data/CCRingBuffer/module-type-S/Array/index.html index 8566ef34..3c9c8a08 100644 --- a/dev/containers-data/CCRingBuffer/module-type-S/Array/index.html +++ b/dev/containers-data/CCRingBuffer/module-type-S/Array/index.html @@ -1,2 +1,2 @@ -Array (containers-data.CCRingBuffer.S.Array)

Module S.Array

The module type of Array for this ring buffer

type elt

The element type

type t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file +Array (containers-data.CCRingBuffer.S.Array)

Module S.Array

The module type of Array for this ring buffer

type elt

The element type

type t

The type of an array instance

val dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
val create : int -> t

Make an array of the given size, filled with dummy elements.

val length : t -> int

length t gets the total number of elements currently in t.

val get : t -> int -> elt

get t i gets the element at position i.

val set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

val sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

val copy : t -> t

copy t makes a fresh copy of the array t.

val blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

val iter : ( elt -> unit ) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

\ No newline at end of file diff --git a/dev/containers-data/CCRingBuffer/module-type-S/index.html b/dev/containers-data/CCRingBuffer/module-type-S/index.html index bdfeb554..5161039e 100644 --- a/dev/containers-data/CCRingBuffer/module-type-S/index.html +++ b/dev/containers-data/CCRingBuffer/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCRingBuffer.S)

Module type CCRingBuffer.S

Ring Buffer

The abstract ring buffer type, made concrete by choice of ARRAY module implementation

module Array : Array.S

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file +S (containers-data.CCRingBuffer.S)

Module type CCRingBuffer.S

Ring Buffer

The abstract ring buffer type, made concrete by choice of ARRAY module implementation

module Array : Array.S

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int -> t

create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.

  • raises Invalid_argument

    if the argument is < 1.

val copy : t -> t

Make a fresh copy of the buffer.

val capacity : t -> int

Length of the inner buffer.

val length : t -> int

Number of elements currently stored in the buffer.

val is_full : t -> bool

true if pushing an element would erase another element.

  • since 1.3
val blit_from : t -> Array.t -> int -> int -> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val blit_into : t -> Array.t -> int -> int -> int

blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.

  • returns

    the number of elements actually copied (min len (length buf)).

  • raises Invalid_argument

    if o,len is not a valid slice of s.

val append : t -> into:t -> unit

append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.

val to_list : t -> Array.elt list

Extract the current content into a list.

val clear : t -> unit

Clear the content of the buffer

val is_empty : t -> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t -> unit

Drop the front element from t.

  • raises Empty

    if the buffer is already empty.

val junk_back : t -> unit

Drop the back element from t.

  • raises Empty

    if the buffer is already empty.

val skip : t -> int -> unit

skip b len removes len elements from the front of b.

  • raises Invalid_argument

    if len > length b.

val iter : t -> f:( Array.elt -> unit ) -> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t -> f:( int -> Array.elt -> unit ) -> unit

iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.

val get_front : t -> int -> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val get_back : t -> int -> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.

  • raises Invalid_argument

    if the index is invalid (> length buf).

val push_back : t -> Array.elt -> unit

Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.

val peek_front : t -> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t -> Array.elt

First value from front of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val peek_back : t -> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t -> Array.elt

Get the last value from back of t, without modification.

  • raises Empty

    if buffer is empty.

  • since 1.3
val take_back : t -> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t -> Array.elt

Take and remove the last value from back of t.

  • raises Empty

    if buffer is already empty.

val take_front : t -> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t -> Array.elt

Take and remove the first value from front of t.

  • raises Empty

    if buffer is already empty.

val of_array : Array.t -> t

Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).

  • since 0.11
val to_array : t -> Array.t

Create an array from the elements, in order.

  • since 0.11
\ No newline at end of file diff --git a/dev/containers-data/CCSimple_queue/Infix/index.html b/dev/containers-data/CCSimple_queue/Infix/index.html index 30e4f365..45e8bb46 100644 --- a/dev/containers-data/CCSimple_queue/Infix/index.html +++ b/dev/containers-data/CCSimple_queue/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers-data.CCSimple_queue.Infix)

Module CCSimple_queue.Infix

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

Alias to map.

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

Alias to append.

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

Alias to snoc.

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

Module CCSimple_queue.Infix

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

Alias to map.

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

Alias to append.

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

Alias to snoc.

\ No newline at end of file diff --git a/dev/containers-data/CCSimple_queue/index.html b/dev/containers-data/CCSimple_queue/index.html index dcacd281..eb123d77 100644 --- a/dev/containers-data/CCSimple_queue/index.html +++ b/dev/containers-data/CCSimple_queue/index.html @@ -1,2 +1,2 @@ -CCSimple_queue (containers-data.CCSimple_queue)

Module CCSimple_queue

Functional queues (fifo)

Simple implementation of functional queues

  • since 1.3
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a gen = unit -> 'a option
type +'a t

Queue containing elements of type 'a

val empty : 'a t
val is_empty : 'a t -> bool
val push : 'a -> 'a t -> 'a t

Push element at the end of the queue.

val snoc : 'a t -> 'a -> 'a t

Flip version of push.

val peek : 'a t -> 'a option

First element of the queue.

val peek_exn : 'a t -> 'a

Same as peek but

  • raises Invalid_argument

    if the queue is empty.

val pop : 'a t -> ('a * 'a t) option

Get and remove the first element.

val pop_exn : 'a t -> 'a * 'a t

Same as pop, but fails on empty queues.

  • raises Invalid_argument

    if the queue is empty.

val junk : 'a t -> 'a t

Remove first element. If the queue is empty, do nothing.

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

Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.

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

Map values.

val rev : 'a t -> 'a t

Reverse the queue. Constant time.

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

Alias to map.

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

Alias to append.

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

Alias to snoc.

val length : 'a t -> int

Number of elements in the queue (linear in time).

val fold : ( 'b -> 'a -> 'b ) -> 'b -> 'a t -> 'b
val iter : ( 'a -> unit ) -> 'a t -> unit
val to_list : 'a t -> 'a list
val add_list : 'a t -> 'a list -> 'a t
val of_list : 'a list -> 'a t
val to_iter : 'a t -> 'a iter
val add_iter : 'a t -> 'a iter -> 'a t
val of_iter : 'a iter -> 'a t
val to_seq : 'a t -> 'a Stdlib.Seq.t

Renamed from to_std_seq since 3.0.

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

Renamed from add_std_seq since 3.0.

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

Renamed from of_std_seq since 3.0.

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

IO

val pp : ?sep:unit printer -> 'a printer -> 'a t printer
\ No newline at end of file +CCSimple_queue (containers-data.CCSimple_queue)

Module CCSimple_queue

Functional queues (fifo)

Simple implementation of functional queues

  • since 1.3
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a gen = unit -> 'a option
type +'a t

Queue containing elements of type 'a

val empty : 'a t
val is_empty : 'a t -> bool
val push : 'a -> 'a t -> 'a t

Push element at the end of the queue.

val snoc : 'a t -> 'a -> 'a t

Flip version of push.

val peek : 'a t -> 'a option

First element of the queue.

val peek_exn : 'a t -> 'a

Same as peek but

  • raises Invalid_argument

    if the queue is empty.

val pop : 'a t -> ('a * 'a t) option

Get and remove the first element.

val pop_exn : 'a t -> 'a * 'a t

Same as pop, but fails on empty queues.

  • raises Invalid_argument

    if the queue is empty.

val junk : 'a t -> 'a t

Remove first element. If the queue is empty, do nothing.

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

Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.

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

Map values.

val rev : 'a t -> 'a t

Reverse the queue. Constant time.

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

Alias to map.

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

Alias to append.

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

Alias to snoc.

val length : 'a t -> int

Number of elements in the queue (linear in time).

val fold : ( 'b -> 'a -> 'b ) -> 'b -> 'a t -> 'b
val iter : ( 'a -> unit ) -> 'a t -> unit
val to_list : 'a t -> 'a list
val add_list : 'a t -> 'a list -> 'a t
val of_list : 'a list -> 'a t
val to_iter : 'a t -> 'a iter
val add_iter : 'a t -> 'a iter -> 'a t
val of_iter : 'a iter -> 'a t
val to_seq : 'a t -> 'a Stdlib.Seq.t

Renamed from to_std_seq since 3.0.

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

Renamed from add_std_seq since 3.0.

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

Renamed from of_std_seq since 3.0.

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

IO

val pp : ?sep:unit printer -> 'a printer -> 'a t printer
\ No newline at end of file diff --git a/dev/containers-data/CCTrie/Make/argument-1-W/index.html b/dev/containers-data/CCTrie/Make/argument-1-W/index.html index 323ba129..582f7acc 100644 --- a/dev/containers-data/CCTrie/Make/argument-1-W/index.html +++ b/dev/containers-data/CCTrie/Make/argument-1-W/index.html @@ -1,2 +1,2 @@ -W (containers-data.CCTrie.Make.1-W)

Parameter Make.1-W

type t
type char_
val compare : char_ -> char_ -> int
val to_iter : t -> char_ iter
val of_list : char_ list -> t
\ No newline at end of file +W (containers-data.CCTrie.Make.1-W)

Parameter Make.1-W

type t
type char_
val compare : char_ -> char_ -> int
val to_iter : t -> char_ iter
val of_list : char_ list -> t
\ No newline at end of file diff --git a/dev/containers-data/CCTrie/Make/index.html b/dev/containers-data/CCTrie/Make/index.html index a1bac417..1bf24721 100644 --- a/dev/containers-data/CCTrie/Make/index.html +++ b/dev/containers-data/CCTrie/Make/index.html @@ -1,2 +1,2 @@ -Make (containers-data.CCTrie.Make)

Module CCTrie.Make

Parameters

module W : WORD

Signature

type char_ = W.char_
type key = W.t
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

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

Module CCTrie.Make

Parameters

module W : WORD

Signature

type char_ = W.char_
type key = W.t
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

\ No newline at end of file diff --git a/dev/containers-data/CCTrie/MakeArray/argument-1-X/index.html b/dev/containers-data/CCTrie/MakeArray/argument-1-X/index.html index c3049047..0991dd66 100644 --- a/dev/containers-data/CCTrie/MakeArray/argument-1-X/index.html +++ b/dev/containers-data/CCTrie/MakeArray/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCTrie.MakeArray.1-X)

Parameter MakeArray.1-X

type t
val compare : t -> t -> int
\ No newline at end of file +X (containers-data.CCTrie.MakeArray.1-X)

Parameter MakeArray.1-X

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCTrie/MakeArray/index.html b/dev/containers-data/CCTrie/MakeArray/index.html index 0a4355d3..0f61c779 100644 --- a/dev/containers-data/CCTrie/MakeArray/index.html +++ b/dev/containers-data/CCTrie/MakeArray/index.html @@ -1,2 +1,2 @@ -MakeArray (containers-data.CCTrie.MakeArray)

Module CCTrie.MakeArray

Parameters

module X : ORDERED

Signature

type char_ = X.t
type key = X.t array
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

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

Module CCTrie.MakeArray

Parameters

module X : ORDERED

Signature

type char_ = X.t
type key = X.t array
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

\ No newline at end of file diff --git a/dev/containers-data/CCTrie/MakeList/argument-1-X/index.html b/dev/containers-data/CCTrie/MakeList/argument-1-X/index.html index 226a88b9..aaf6b47a 100644 --- a/dev/containers-data/CCTrie/MakeList/argument-1-X/index.html +++ b/dev/containers-data/CCTrie/MakeList/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCTrie.MakeList.1-X)

Parameter MakeList.1-X

type t
val compare : t -> t -> int
\ No newline at end of file +X (containers-data.CCTrie.MakeList.1-X)

Parameter MakeList.1-X

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCTrie/MakeList/index.html b/dev/containers-data/CCTrie/MakeList/index.html index 4180454e..fd538657 100644 --- a/dev/containers-data/CCTrie/MakeList/index.html +++ b/dev/containers-data/CCTrie/MakeList/index.html @@ -1,2 +1,2 @@ -MakeList (containers-data.CCTrie.MakeList)

Module CCTrie.MakeList

Parameters

module X : ORDERED

Signature

type char_ = X.t
type key = X.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

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

Module CCTrie.MakeList

Parameters

module X : ORDERED

Signature

type char_ = X.t
type key = X.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

\ No newline at end of file diff --git a/dev/containers-data/CCTrie/String/index.html b/dev/containers-data/CCTrie/String/index.html index 1e7ba8d3..e2e611b5 100644 --- a/dev/containers-data/CCTrie/String/index.html +++ b/dev/containers-data/CCTrie/String/index.html @@ -1,2 +1,2 @@ -String (containers-data.CCTrie.String)

Module CCTrie.String

type char_ = char
type key = string
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

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

Module CCTrie.String

type char_ = char
type key = string
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

\ No newline at end of file diff --git a/dev/containers-data/CCTrie/index.html b/dev/containers-data/CCTrie/index.html index 5a08592f..074562dc 100644 --- a/dev/containers-data/CCTrie/index.html +++ b/dev/containers-data/CCTrie/index.html @@ -1,4 +1,4 @@ -CCTrie (containers-data.CCTrie)

Module CCTrie

Prefix Tree

type 'a iter = ( 'a -> unit ) -> unit
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]

Signatures

A Composite Word

Words are made of characters, who belong to a total order

module type WORD = sig ... end
module type S = sig ... end

Implementation

module Make (W : WORD) : S with type key = W.t and type char_ = W.char_
module type ORDERED = sig ... end
module MakeArray +CCTrie (containers-data.CCTrie)

Module CCTrie

Prefix Tree

type 'a iter = ( 'a -> unit ) -> unit
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]

Signatures

A Composite Word

Words are made of characters, who belong to a total order

module type WORD = sig ... end
module type S = sig ... end

Implementation

module Make (W : WORD) : S with type key = W.t and type char_ = W.char_
module type ORDERED = sig ... end
module MakeArray (X : ORDERED) : S with type key = X.t array and type char_ = X.t
module MakeList (X : ORDERED) : S with type key = X.t list and type char_ = X.t
module String : S with type key = string and type char_ = char
\ No newline at end of file diff --git a/dev/containers-data/CCTrie/module-type-ORDERED/index.html b/dev/containers-data/CCTrie/module-type-ORDERED/index.html index e2110561..748ce098 100644 --- a/dev/containers-data/CCTrie/module-type-ORDERED/index.html +++ b/dev/containers-data/CCTrie/module-type-ORDERED/index.html @@ -1,2 +1,2 @@ -ORDERED (containers-data.CCTrie.ORDERED)

Module type CCTrie.ORDERED

type t
val compare : t -> t -> int
\ No newline at end of file +ORDERED (containers-data.CCTrie.ORDERED)

Module type CCTrie.ORDERED

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCTrie/module-type-S/index.html b/dev/containers-data/CCTrie/module-type-S/index.html index 146ffa82..c68de924 100644 --- a/dev/containers-data/CCTrie/module-type-S/index.html +++ b/dev/containers-data/CCTrie/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers-data.CCTrie.S)

Module type CCTrie.S

type char_
type key
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

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

Module type CCTrie.S

type char_
type key
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val add : key -> 'a -> 'a t -> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key -> 'a t -> 'a t

Remove the key, if present.

val find : key -> 'a t -> 'a option

Find the value associated with the key, if any.

val find_exn : key -> 'a t -> 'a

Same as find but can fail.

  • raises Not_found

    if the key is not present.

val longest_prefix : key -> 'a t -> key

longest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".

  • since 0.17
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.

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

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : ( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : ( key -> 'a -> unit ) -> 'a t -> unit

Same as fold, but for effectful functions.

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

More efficient version of fold, that doesn't keep keys.

val iter_values : ( 'a -> unit ) -> 'a t -> unit
val merge : ( 'a -> 'a -> 'a option ) -> 'a t -> 'a t -> 'a t

Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.

val size : _ t -> int

Number of bindings.

Conversions
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val to_iter_values : 'a t -> 'a iter
val to_tree : 'a t -> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key -> 'a t -> (key * 'a) iter

All bindings whose key is bigger or equal to the given key, in ascending order.

val below : key -> 'a t -> (key * 'a) iter

All bindings whose key is smaller or equal to the given key, in decreasing order.

\ No newline at end of file diff --git a/dev/containers-data/CCTrie/module-type-WORD/index.html b/dev/containers-data/CCTrie/module-type-WORD/index.html index 339c4456..bd8d3d12 100644 --- a/dev/containers-data/CCTrie/module-type-WORD/index.html +++ b/dev/containers-data/CCTrie/module-type-WORD/index.html @@ -1,2 +1,2 @@ -WORD (containers-data.CCTrie.WORD)

Module type CCTrie.WORD

type t
type char_
val compare : char_ -> char_ -> int
val to_iter : t -> char_ iter
val of_list : char_ list -> t
\ No newline at end of file +WORD (containers-data.CCTrie.WORD)

Module type CCTrie.WORD

type t
type char_
val compare : char_ -> char_ -> int
val to_iter : t -> char_ iter
val of_list : char_ list -> t
\ No newline at end of file diff --git a/dev/containers-data/CCWBTree/Make/argument-1-X/index.html b/dev/containers-data/CCWBTree/Make/argument-1-X/index.html index 474b1ac5..9dea930d 100644 --- a/dev/containers-data/CCWBTree/Make/argument-1-X/index.html +++ b/dev/containers-data/CCWBTree/Make/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCWBTree.Make.1-X)

Parameter Make.1-X

type t
val compare : t -> t -> int
\ No newline at end of file +X (containers-data.CCWBTree.Make.1-X)

Parameter Make.1-X

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCWBTree/Make/index.html b/dev/containers-data/CCWBTree/Make/index.html index 017c071c..3ec0c8f9 100644 --- a/dev/containers-data/CCWBTree/Make/index.html +++ b/dev/containers-data/CCWBTree/Make/index.html @@ -1,5 +1,5 @@ -Make (containers-data.CCWBTree.Make)

Module CCWBTree.Make

Parameters

module X : ORD

Signature

type key = X.t
type +'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if the key is not present.

val nth : int -> 'a t -> (key * 'a) option

nth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).

val nth_exn : int -> 'a t -> key * 'a
  • raises Not_found

    if the index is invalid.

val get_rank : key -> 'a t -> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • since 1.4
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val cardinal : _ t -> int
val weight : _ t -> int
val fold : f:( 'b -> key -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val mapi : f:( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : f:( key -> 'a -> unit ) -> 'a t -> unit
val split : key -> 'a t -> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.

val merge : +Make (containers-data.CCWBTree.Make)

Module CCWBTree.Make

Parameters

module X : ORD

Signature

type key = X.t
type +'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if the key is not present.

val nth : int -> 'a t -> (key * 'a) option

nth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).

val nth_exn : int -> 'a t -> key * 'a
  • raises Not_found

    if the index is invalid.

val get_rank : key -> 'a t -> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • since 1.4
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val cardinal : _ t -> int
val weight : _ t -> int
val fold : f:( 'b -> key -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val mapi : f:( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : f:( key -> 'a -> unit ) -> 'a t -> unit
val split : key -> 'a t -> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.

val merge : f:( key -> 'a option -> 'b option -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers-data/CCWBTree/MakeFull/argument-1-X/index.html b/dev/containers-data/CCWBTree/MakeFull/argument-1-X/index.html index d47a769e..e957ba79 100644 --- a/dev/containers-data/CCWBTree/MakeFull/argument-1-X/index.html +++ b/dev/containers-data/CCWBTree/MakeFull/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers-data.CCWBTree.MakeFull.1-X)

Parameter MakeFull.1-X

include ORD
type t
val compare : t -> t -> int
val weight : t -> int
\ No newline at end of file +X (containers-data.CCWBTree.MakeFull.1-X)

Parameter MakeFull.1-X

include ORD
type t
val compare : t -> t -> int
val weight : t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCWBTree/MakeFull/index.html b/dev/containers-data/CCWBTree/MakeFull/index.html index 9897b157..d14ad81c 100644 --- a/dev/containers-data/CCWBTree/MakeFull/index.html +++ b/dev/containers-data/CCWBTree/MakeFull/index.html @@ -1,5 +1,5 @@ -MakeFull (containers-data.CCWBTree.MakeFull)

Module CCWBTree.MakeFull

Use the custom X.weight function

Parameters

module X : KEY

Signature

type key = X.t
type +'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if the key is not present.

val nth : int -> 'a t -> (key * 'a) option

nth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).

val nth_exn : int -> 'a t -> key * 'a
  • raises Not_found

    if the index is invalid.

val get_rank : key -> 'a t -> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • since 1.4
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val cardinal : _ t -> int
val weight : _ t -> int
val fold : f:( 'b -> key -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val mapi : f:( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : f:( key -> 'a -> unit ) -> 'a t -> unit
val split : key -> 'a t -> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.

val merge : +MakeFull (containers-data.CCWBTree.MakeFull)

Module CCWBTree.MakeFull

Use the custom X.weight function

Parameters

module X : KEY

Signature

type key = X.t
type +'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if the key is not present.

val nth : int -> 'a t -> (key * 'a) option

nth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).

val nth_exn : int -> 'a t -> key * 'a
  • raises Not_found

    if the index is invalid.

val get_rank : key -> 'a t -> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • since 1.4
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val cardinal : _ t -> int
val weight : _ t -> int
val fold : f:( 'b -> key -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val mapi : f:( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : f:( key -> 'a -> unit ) -> 'a t -> unit
val split : key -> 'a t -> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.

val merge : f:( key -> 'a option -> 'b option -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers-data/CCWBTree/index.html b/dev/containers-data/CCWBTree/index.html index 4c937b69..495bd6da 100644 --- a/dev/containers-data/CCWBTree/index.html +++ b/dev/containers-data/CCWBTree/index.html @@ -1,2 +1,2 @@ -CCWBTree (containers-data.CCWBTree)

Module CCWBTree

Weight-Balanced Tree

status: experimental

  • since 0.13
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type ORD = sig ... end
module type KEY = sig ... end

Signature

module type S = sig ... end

Functor

module Make (X : ORD) : S with type key = X.t
module MakeFull (X : KEY) : S with type key = X.t

Use the custom X.weight function

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

Module CCWBTree

Weight-Balanced Tree

status: experimental

  • since 0.13
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type ORD = sig ... end
module type KEY = sig ... end

Signature

module type S = sig ... end

Functor

module Make (X : ORD) : S with type key = X.t
module MakeFull (X : KEY) : S with type key = X.t

Use the custom X.weight function

\ No newline at end of file diff --git a/dev/containers-data/CCWBTree/module-type-KEY/index.html b/dev/containers-data/CCWBTree/module-type-KEY/index.html index e23528a6..4722dc49 100644 --- a/dev/containers-data/CCWBTree/module-type-KEY/index.html +++ b/dev/containers-data/CCWBTree/module-type-KEY/index.html @@ -1,2 +1,2 @@ -KEY (containers-data.CCWBTree.KEY)

Module type CCWBTree.KEY

include ORD
type t
val compare : t -> t -> int
val weight : t -> int
\ No newline at end of file +KEY (containers-data.CCWBTree.KEY)

Module type CCWBTree.KEY

include ORD
type t
val compare : t -> t -> int
val weight : t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCWBTree/module-type-ORD/index.html b/dev/containers-data/CCWBTree/module-type-ORD/index.html index a70dfa4a..a38b7f6b 100644 --- a/dev/containers-data/CCWBTree/module-type-ORD/index.html +++ b/dev/containers-data/CCWBTree/module-type-ORD/index.html @@ -1,2 +1,2 @@ -ORD (containers-data.CCWBTree.ORD)

Module type CCWBTree.ORD

type t
val compare : t -> t -> int
\ No newline at end of file +ORD (containers-data.CCWBTree.ORD)

Module type CCWBTree.ORD

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/containers-data/CCWBTree/module-type-S/index.html b/dev/containers-data/CCWBTree/module-type-S/index.html index 83e1b79c..0d8add83 100644 --- a/dev/containers-data/CCWBTree/module-type-S/index.html +++ b/dev/containers-data/CCWBTree/module-type-S/index.html @@ -1,5 +1,5 @@ -S (containers-data.CCWBTree.S)

Module type CCWBTree.S

type key
type +'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if the key is not present.

val nth : int -> 'a t -> (key * 'a) option

nth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).

val nth_exn : int -> 'a t -> key * 'a
  • raises Not_found

    if the index is invalid.

val get_rank : key -> 'a t -> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • since 1.4
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val cardinal : _ t -> int
val weight : _ t -> int
val fold : f:( 'b -> key -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val mapi : f:( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : f:( key -> 'a -> unit ) -> 'a t -> unit
val split : key -> 'a t -> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.

val merge : +S (containers-data.CCWBTree.S)

Module type CCWBTree.S

type key
type +'a t
val empty : 'a t
val is_empty : _ t -> bool
val singleton : key -> 'a -> 'a t
val mem : key -> _ t -> bool
val get : key -> 'a t -> 'a option
val get_exn : key -> 'a t -> 'a
  • raises Not_found

    if the key is not present.

val nth : int -> 'a t -> (key * 'a) option

nth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).

val nth_exn : int -> 'a t -> key * 'a
  • raises Not_found

    if the index is invalid.

val get_rank : key -> 'a t -> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • since 1.4
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t

update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

val cardinal : _ t -> int
val weight : _ t -> int
val fold : f:( 'b -> key -> 'a -> 'b ) -> x:'b -> 'a t -> 'b
val mapi : f:( key -> 'a -> 'b ) -> 'a t -> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

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

Map values, giving only the value.

  • since 0.17
val iter : f:( key -> 'a -> unit ) -> 'a t -> unit
val split : key -> 'a t -> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.

val merge : f:( key -> 'a option -> 'b option -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers-data/CCZipper/index.html b/dev/containers-data/CCZipper/index.html index 2f905e7f..52858214 100644 --- a/dev/containers-data/CCZipper/index.html +++ b/dev/containers-data/CCZipper/index.html @@ -1,2 +1,2 @@ -CCZipper (containers-data.CCZipper)

Module CCZipper

List Zipper

  • since 1.0
type 'a t = 'a list * 'a list

The pair l, r represents the list List.rev_append l r, but with the focus on r

val empty : 'a t

Empty zipper.

val is_empty : _ t -> bool

Empty zipper? Returns true iff the two lists are empty.

val to_list : 'a t -> 'a list

Convert the zipper back to a list. to_list (l,r) is List.rev_append l r.

val to_rev_list : 'a t -> 'a list

Convert the zipper back to a reversed list. In other words, to_list (l,r) is List.rev_append r l.

val make : 'a list -> 'a t

Create a zipper pointing at the first element of the list.

val left : 'a t -> 'a t

Go to the left, or do nothing if the zipper is already at leftmost pos.

val left_exn : 'a t -> 'a t

Go to the left, or

  • raises Invalid_argument

    if the zipper is already at leftmost pos.

val right : 'a t -> 'a t

Go to the right, or do nothing if the zipper is already at rightmost pos.

val right_exn : 'a t -> 'a t

Go to the right, or

  • raises Invalid_argument

    if the zipper is already at rightmost pos.

val modify : ( 'a option -> 'a option ) -> 'a t -> 'a t

Modify the current element, if any, by returning a new element, or returning None if the element is to be deleted.

val insert : 'a -> 'a t -> 'a t

Insert an element at the current position. If an element was focused, insert x l adds x just before it, and focuses on x.

val remove : 'a t -> 'a t

remove l removes the current element, if any.

val is_focused : _ t -> bool

Is the zipper focused on some element? That is, will focused return a Some v?

val focused : 'a t -> 'a option

Return the focused element, if any. focused zip = Some _ iff empty zip = false.

val focused_exn : 'a t -> 'a

Return the focused element, or

  • raises Not_found

    if the zipper is at an end.

val drop_before : 'a t -> 'a t

Drop every element on the "left" (calling left then will do nothing).

val drop_after : 'a t -> 'a t

Drop every element on the "right" (calling right then will do nothing), keeping the focused element, if any.

val drop_after_and_focused : 'a t -> 'a t

Drop every element on the "right" (calling right then will do nothing), including the focused element if it is present.

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

Module CCZipper

List Zipper

  • since 1.0
type 'a t = 'a list * 'a list

The pair l, r represents the list List.rev_append l r, but with the focus on r

val empty : 'a t

Empty zipper.

val is_empty : _ t -> bool

Empty zipper? Returns true iff the two lists are empty.

val to_list : 'a t -> 'a list

Convert the zipper back to a list. to_list (l,r) is List.rev_append l r.

val to_rev_list : 'a t -> 'a list

Convert the zipper back to a reversed list. In other words, to_list (l,r) is List.rev_append r l.

val make : 'a list -> 'a t

Create a zipper pointing at the first element of the list.

val left : 'a t -> 'a t

Go to the left, or do nothing if the zipper is already at leftmost pos.

val left_exn : 'a t -> 'a t

Go to the left, or

  • raises Invalid_argument

    if the zipper is already at leftmost pos.

val right : 'a t -> 'a t

Go to the right, or do nothing if the zipper is already at rightmost pos.

val right_exn : 'a t -> 'a t

Go to the right, or

  • raises Invalid_argument

    if the zipper is already at rightmost pos.

val modify : ( 'a option -> 'a option ) -> 'a t -> 'a t

Modify the current element, if any, by returning a new element, or returning None if the element is to be deleted.

val insert : 'a -> 'a t -> 'a t

Insert an element at the current position. If an element was focused, insert x l adds x just before it, and focuses on x.

val remove : 'a t -> 'a t

remove l removes the current element, if any.

val is_focused : _ t -> bool

Is the zipper focused on some element? That is, will focused return a Some v?

val focused : 'a t -> 'a option

Return the focused element, if any. focused zip = Some _ iff empty zip = false.

val focused_exn : 'a t -> 'a

Return the focused element, or

  • raises Not_found

    if the zipper is at an end.

val drop_before : 'a t -> 'a t

Drop every element on the "left" (calling left then will do nothing).

val drop_after : 'a t -> 'a t

Drop every element on the "right" (calling right then will do nothing), keeping the focused element, if any.

val drop_after_and_focused : 'a t -> 'a t

Drop every element on the "right" (calling right then will do nothing), including the focused element if it is present.

\ No newline at end of file diff --git a/dev/containers-data/Containers_data_top/index.html b/dev/containers-data/Containers_data_top/index.html index a993de04..e50e1102 100644 --- a/dev/containers-data/Containers_data_top/index.html +++ b/dev/containers-data/Containers_data_top/index.html @@ -1,2 +1,2 @@ -Containers_data_top (containers-data.Containers_data_top)

Module Containers_data_top

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val eval_exn : string -> bool
val install_printer : string -> unit
val install_printers : string list -> unit
\ No newline at end of file +Containers_data_top (containers-data.Containers_data_top)

Module Containers_data_top

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val eval_exn : string -> bool
val install_printer : string -> unit
val install_printers : string list -> unit
\ No newline at end of file diff --git a/dev/containers-data/index.html b/dev/containers-data/index.html index 10f7adfc..015c8d23 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/CCBlockingQueue/index.html b/dev/containers-thread/CCBlockingQueue/index.html index c221d8f1..a040c971 100644 --- a/dev/containers-thread/CCBlockingQueue/index.html +++ b/dev/containers-thread/CCBlockingQueue/index.html @@ -1,2 +1,2 @@ -CCBlockingQueue (containers-thread.CCBlockingQueue)

Module CCBlockingQueue

Blocking Queue

This queue has a limited size. Pushing a value on the queue when it is full will block.

  • since 0.16
type 'a t

Safe-thread queue for values of type 'a

val create : int -> 'a t

Create a new queue of size n. Using n=max_int amounts to using an infinite queue (2^61 items is a lot to fit in memory); using n=1 amounts to using a box with 0 or 1 elements inside.

  • raises Invalid_argument

    if n < 1.

val push : 'a t -> 'a -> unit

push q x pushes x into q, blocking if the queue is full.

val take : 'a t -> 'a

Take the first element, blocking if needed.

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

Push items of the list, one by one.

val take_list : 'a t -> int -> 'a list

take_list n q takes n elements out of q.

val try_take : 'a t -> 'a option

Take the first element if the queue is not empty, return None otherwise.

val try_push : 'a t -> 'a -> bool

try_push q x pushes x into q if q is not full, in which case it returns true. If it fails because q is full, it returns false.

val peek : 'a t -> 'a option

peek q returns Some x if x is the first element of q, otherwise it returns None.

val size : _ t -> int

Number of elements currently in the queue.

val capacity : _ t -> int

Number of values the queue can hold.

\ No newline at end of file +CCBlockingQueue (containers-thread.CCBlockingQueue)

Module CCBlockingQueue

Blocking Queue

This queue has a limited size. Pushing a value on the queue when it is full will block.

  • since 0.16
type 'a t

Safe-thread queue for values of type 'a

val create : int -> 'a t

Create a new queue of size n. Using n=max_int amounts to using an infinite queue (2^61 items is a lot to fit in memory); using n=1 amounts to using a box with 0 or 1 elements inside.

  • raises Invalid_argument

    if n < 1.

val push : 'a t -> 'a -> unit

push q x pushes x into q, blocking if the queue is full.

val take : 'a t -> 'a

Take the first element, blocking if needed.

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

Push items of the list, one by one.

val take_list : 'a t -> int -> 'a list

take_list n q takes n elements out of q.

val try_take : 'a t -> 'a option

Take the first element if the queue is not empty, return None otherwise.

val try_push : 'a t -> 'a -> bool

try_push q x pushes x into q if q is not full, in which case it returns true. If it fails because q is full, it returns false.

val peek : 'a t -> 'a option

peek q returns Some x if x is the first element of q, otherwise it returns None.

val size : _ t -> int

Number of elements currently in the queue.

val capacity : _ t -> int

Number of values the queue can hold.

\ No newline at end of file diff --git a/dev/containers-thread/CCLock/LockRef/index.html b/dev/containers-thread/CCLock/LockRef/index.html index 58780373..e8e89340 100644 --- a/dev/containers-thread/CCLock/LockRef/index.html +++ b/dev/containers-thread/CCLock/LockRef/index.html @@ -1,2 +1,2 @@ -LockRef (containers-thread.CCLock.LockRef)

Module CCLock.LockRef

Type allowing to manipulate the lock as a reference.

  • since 0.13
type 'a t
val get : 'a t -> 'a
val set : 'a t -> 'a -> unit
val update : 'a t -> ( 'a -> 'a ) -> unit
\ No newline at end of file +LockRef (containers-thread.CCLock.LockRef)

Module CCLock.LockRef

Type allowing to manipulate the lock as a reference.

  • since 0.13
type 'a t
val get : 'a t -> 'a
val set : 'a t -> 'a -> unit
val update : 'a t -> ( 'a -> 'a ) -> unit
\ No newline at end of file diff --git a/dev/containers-thread/CCLock/index.html b/dev/containers-thread/CCLock/index.html index 448a1893..05149034 100644 --- a/dev/containers-thread/CCLock/index.html +++ b/dev/containers-thread/CCLock/index.html @@ -1,2 +1,2 @@ -CCLock (containers-thread.CCLock)

Module CCLock

Utils around Mutex

A value wrapped into a Mutex, for more safety.

  • since 0.8
type 'a t

A value surrounded with a lock

val create : 'a -> 'a t

Create a new protected value.

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

with_lock l f runs f x where x is the value protected with the lock l, in a critical section. If f x fails, with_lock l f fails too but the lock is released.

val try_with_lock : 'a t -> ( 'a -> 'b ) -> 'b option

try_with_lock l f runs f x in a critical section if l is not locked. x is the value protected by the lock l. If f x fails, try_with_lock l f fails too but the lock is released.

  • since 0.22
module LockRef : sig ... end

Type allowing to manipulate the lock as a reference.

val with_lock_as_ref : 'a t -> f:( 'a LockRef.t -> 'b ) -> 'b

with_lock_as_ref l f calls f with a reference-like object that allows to manipulate the value of l safely. The object passed to f must not escape the function call.

  • since 0.13
val update : 'a t -> ( 'a -> 'a ) -> unit

update l f replaces the content x of l with f x, atomically.

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

update_map l f computes x', y = f (get l), then puts x' in l and returns y.

  • since 0.16
val mutex : _ t -> Mutex.t

Underlying mutex.

val get : 'a t -> 'a

Atomically get the value in the lock. The value that is returned isn't protected!

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

Atomically set the value.

  • since 0.13
val incr : int t -> unit

Atomically increment the value.

  • since 0.13
val decr : int t -> unit

Atomically decrement the value.

  • since 0.13
val incr_then_get : int t -> int

incr_then_get x increments x, and returns its new value.

  • since 0.16
val get_then_incr : int t -> int

get_then_incr x increments x, and returns its previous value.

  • since 0.16
val decr_then_get : int t -> int

decr_then_get x decrements x, and returns its new value.

  • since 0.16
val get_then_decr : int t -> int

get_then_decr x decrements x, and returns its previous value.

  • since 0.16
val get_then_set : bool t -> bool

get_then_set b sets b to true, and returns the old value.

  • since 0.16
val get_then_clear : bool t -> bool

get_then_clear b sets b to false, and returns the old value.

  • since 0.16
\ No newline at end of file +CCLock (containers-thread.CCLock)

Module CCLock

Utils around Mutex

A value wrapped into a Mutex, for more safety.

  • since 0.8
type 'a t

A value surrounded with a lock

val create : 'a -> 'a t

Create a new protected value.

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

with_lock l f runs f x where x is the value protected with the lock l, in a critical section. If f x fails, with_lock l f fails too but the lock is released.

val try_with_lock : 'a t -> ( 'a -> 'b ) -> 'b option

try_with_lock l f runs f x in a critical section if l is not locked. x is the value protected by the lock l. If f x fails, try_with_lock l f fails too but the lock is released.

  • since 0.22
module LockRef : sig ... end

Type allowing to manipulate the lock as a reference.

val with_lock_as_ref : 'a t -> f:( 'a LockRef.t -> 'b ) -> 'b

with_lock_as_ref l f calls f with a reference-like object that allows to manipulate the value of l safely. The object passed to f must not escape the function call.

  • since 0.13
val update : 'a t -> ( 'a -> 'a ) -> unit

update l f replaces the content x of l with f x, atomically.

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

update_map l f computes x', y = f (get l), then puts x' in l and returns y.

  • since 0.16
val mutex : _ t -> Mutex.t

Underlying mutex.

val get : 'a t -> 'a

Atomically get the value in the lock. The value that is returned isn't protected!

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

Atomically set the value.

  • since 0.13
val incr : int t -> unit

Atomically increment the value.

  • since 0.13
val decr : int t -> unit

Atomically decrement the value.

  • since 0.13
val incr_then_get : int t -> int

incr_then_get x increments x, and returns its new value.

  • since 0.16
val get_then_incr : int t -> int

get_then_incr x increments x, and returns its previous value.

  • since 0.16
val decr_then_get : int t -> int

decr_then_get x decrements x, and returns its new value.

  • since 0.16
val get_then_decr : int t -> int

get_then_decr x decrements x, and returns its previous value.

  • since 0.16
val get_then_set : bool t -> bool

get_then_set b sets b to true, and returns the old value.

  • since 0.16
val get_then_clear : bool t -> bool

get_then_clear b sets b to false, and returns the old value.

  • since 0.16
\ No newline at end of file diff --git a/dev/containers-thread/CCPool/Make/Fut/Infix/index.html b/dev/containers-thread/CCPool/Make/Fut/Infix/index.html index 813806d4..76358dcb 100644 --- a/dev/containers-thread/CCPool/Make/Fut/Infix/index.html +++ b/dev/containers-thread/CCPool/Make/Fut/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers-thread.CCPool.Make.Fut.Infix)

Module Fut.Infix

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

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
include 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 +Infix (containers-thread.CCPool.Make.Fut.Infix)

Module Fut.Infix

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

Let operators on OCaml >= 4.08.0, nothing otherwise

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

Module Make.Fut

Futures

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

type 'a t

A future value of type 'a

type 'a future = 'a t

Constructors

val return : 'a -> 'a t

Future that is already computed.

val fail : exn -> 'a t

Future that fails immediately.

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

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

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

Basics

val get : 'a t -> 'a

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

val state : 'a t -> 'a state

State of the future.

val is_done : 'a t -> bool

Is the future evaluated (success/failure)?

Combinators

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

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

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

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

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

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

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

Monadic combination of futures.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Cartesian product of the content of these futures.

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

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

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

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

val sleep : float -> unit t

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

module Infix : sig ... end
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 +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 index d2da4f22..5734ba21 100644 --- a/dev/containers-thread/CCPool/Make/argument-1-P/index.html +++ b/dev/containers-thread/CCPool/Make/argument-1-P/index.html @@ -1,2 +1,2 @@ -P (containers-thread.CCPool.Make.1-P)

Parameter Make.1-P

val max_size : int

Maximum number of threads in the pool.

\ No newline at end of file +P (containers-thread.CCPool.Make.1-P)

Parameter Make.1-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 index 9e85e022..c4f41a23 100644 --- a/dev/containers-thread/CCPool/Make/index.html +++ b/dev/containers-thread/CCPool/Make/index.html @@ -1,2 +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 +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/index.html b/dev/containers-thread/CCPool/index.html index d5271442..86b1c878 100644 --- a/dev/containers-thread/CCPool/index.html +++ b/dev/containers-thread/CCPool/index.html @@ -1,2 +1,2 @@ -CCPool (containers-thread.CCPool)

Module CCPool

Thread Pool, and Futures

Renamed and heavily updated from CCFuture.

  • since 0.16
type +'a state =
| Done of 'a
| Waiting
| Failed of exn
module type PARAM = sig ... end
exception Stopped
module Make (P : PARAM) : sig ... end
\ No newline at end of file +CCPool (containers-thread.CCPool)

Module CCPool

Thread Pool, and Futures

Renamed and heavily updated from CCFuture.

  • since 0.16
type +'a state =
| Done of 'a
| Waiting
| Failed of exn
module type PARAM = sig ... end
exception Stopped
module Make (P : PARAM) : 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 index c32d8382..c1c16fce 100644 --- a/dev/containers-thread/CCPool/module-type-PARAM/index.html +++ b/dev/containers-thread/CCPool/module-type-PARAM/index.html @@ -1,2 +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 +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-thread/CCSemaphore/index.html b/dev/containers-thread/CCSemaphore/index.html index f73ea746..90d097e1 100644 --- a/dev/containers-thread/CCSemaphore/index.html +++ b/dev/containers-thread/CCSemaphore/index.html @@ -1,2 +1,2 @@ -CCSemaphore (containers-thread.CCSemaphore)

Module CCSemaphore

Semaphores

  • since 0.13
type t

A semaphore

val create : int -> t

create n creates a semaphore with initial value n.

  • raises Invalid_argument

    if n <= 0.

val get : t -> int

Current value.

val acquire : int -> t -> unit

acquire n s blocks until get s >= n, then atomically sets s := !s - n.

val release : int -> t -> unit

release n s atomically sets s := !s + n.

val with_acquire : n:int -> t -> f:( unit -> 'a ) -> 'a

with_acquire ~n s ~f first acquires s with n units, calls f (), and then releases s with n units. Safely release the semaphore even if f () fails.

val wait_until_at_least : n:int -> t -> f:( unit -> 'a ) -> 'a

wait_until_at_least ~n s ~f waits until get s >= n, then calls f () and returns its result. Doesn't modify the semaphore.

\ No newline at end of file +CCSemaphore (containers-thread.CCSemaphore)

Module CCSemaphore

Semaphores

  • since 0.13
type t

A semaphore

val create : int -> t

create n creates a semaphore with initial value n.

  • raises Invalid_argument

    if n <= 0.

val get : t -> int

Current value.

val acquire : int -> t -> unit

acquire n s blocks until get s >= n, then atomically sets s := !s - n.

val release : int -> t -> unit

release n s atomically sets s := !s + n.

val with_acquire : n:int -> t -> f:( unit -> 'a ) -> 'a

with_acquire ~n s ~f first acquires s with n units, calls f (), and then releases s with n units. Safely release the semaphore even if f () fails.

val wait_until_at_least : n:int -> t -> f:( unit -> 'a ) -> 'a

wait_until_at_least ~n s ~f waits until get s >= n, then calls f () and returns its result. Doesn't modify the semaphore.

\ No newline at end of file diff --git a/dev/containers-thread/CCThread/Arr/index.html b/dev/containers-thread/CCThread/Arr/index.html index 77482421..67a5d20d 100644 --- a/dev/containers-thread/CCThread/Arr/index.html +++ b/dev/containers-thread/CCThread/Arr/index.html @@ -1,2 +1,2 @@ -Arr (containers-thread.CCThread.Arr)

Module CCThread.Arr

Array of threads

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

Arr.spawn n f creates an array res of length n, such that res.(i) = spawn (fun () -> f i).

val join : t array -> unit

Arr.join a joins every thread in a.

\ No newline at end of file +Arr (containers-thread.CCThread.Arr)

Module CCThread.Arr

Array of threads

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

Arr.spawn n f creates an array res of length n, such that res.(i) = spawn (fun () -> f i).

val join : t array -> unit

Arr.join a joins every thread in a.

\ No newline at end of file diff --git a/dev/containers-thread/CCThread/Barrier/index.html b/dev/containers-thread/CCThread/Barrier/index.html index 17509dba..0cac68db 100644 --- a/dev/containers-thread/CCThread/Barrier/index.html +++ b/dev/containers-thread/CCThread/Barrier/index.html @@ -1,2 +1,2 @@ -Barrier (containers-thread.CCThread.Barrier)

Module CCThread.Barrier

type t

Barrier, used to synchronize threads

val create : unit -> t

Create a barrier.

val reset : t -> unit

Reset to initial (non-triggered) state.

val wait : t -> unit

wait b waits for barrier b to be activated by activate b. All threads calling this wait until activate b is called. If b is already activated, wait b does nothing.

val activate : t -> unit

activate b unblocks all threads that were waiting on b.

val activated : t -> bool

activated b returns true iff activate b was called, and reset b was not called since. In other words, activated b = true means wait b will not block.

\ No newline at end of file +Barrier (containers-thread.CCThread.Barrier)

Module CCThread.Barrier

type t

Barrier, used to synchronize threads

val create : unit -> t

Create a barrier.

val reset : t -> unit

Reset to initial (non-triggered) state.

val wait : t -> unit

wait b waits for barrier b to be activated by activate b. All threads calling this wait until activate b is called. If b is already activated, wait b does nothing.

val activate : t -> unit

activate b unblocks all threads that were waiting on b.

val activated : t -> bool

activated b returns true iff activate b was called, and reset b was not called since. In other words, activated b = true means wait b will not block.

\ No newline at end of file diff --git a/dev/containers-thread/CCThread/index.html b/dev/containers-thread/CCThread/index.html index cc3ad4b5..36d6b4be 100644 --- a/dev/containers-thread/CCThread/index.html +++ b/dev/containers-thread/CCThread/index.html @@ -1,2 +1,2 @@ -CCThread (containers-thread.CCThread)

Module CCThread

Threads

status: unstable

  • since 0.13
type t = Thread.t
val spawn : ( unit -> _ ) -> t

spawn f creates a new thread that runs f ().

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

spawn1 f x is like spawn (fun () -> f x).

  • since 0.16
val spawn2 : ( 'a -> 'b -> _ ) -> 'a -> 'b -> t

spawn2 f x y is like spawn (fun () -> f x y).

  • since 0.16
val detach : ( unit -> 'a ) -> unit

detach f is the same as ignore (spawn f).

module Arr : sig ... end

Single-Use Barrier

module Barrier : sig ... end
\ No newline at end of file +CCThread (containers-thread.CCThread)

Module CCThread

Threads

status: unstable

  • since 0.13
type t = Thread.t
val spawn : ( unit -> _ ) -> t

spawn f creates a new thread that runs f ().

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

spawn1 f x is like spawn (fun () -> f x).

  • since 0.16
val spawn2 : ( 'a -> 'b -> _ ) -> 'a -> 'b -> t

spawn2 f x y is like spawn (fun () -> f x y).

  • since 0.16
val detach : ( unit -> 'a ) -> unit

detach f is the same as ignore (spawn f).

module Arr : sig ... end

Single-Use Barrier

module Barrier : sig ... end
\ No newline at end of file diff --git a/dev/containers-thread/CCTimer/index.html b/dev/containers-thread/CCTimer/index.html index 9fc88193..8793f368 100644 --- a/dev/containers-thread/CCTimer/index.html +++ b/dev/containers-thread/CCTimer/index.html @@ -1,2 +1,2 @@ -CCTimer (containers-thread.CCTimer)

Module CCTimer

Event timer

Used to be part of CCFuture.

  • since 0.16
type t

A scheduler for events. It runs in its own thread.

val create : unit -> t

A new timer.

val set_exn_handler : t -> ( exn -> unit ) -> unit

set_exn_handler timer f registers f so that any exception raised by a task scheduled in timer is given to f.

exception Stopped
val after : t -> float -> f:( unit -> _ ) -> unit

Call the callback f after the given number of seconds.

  • raises Stopped

    if the timer was stopped.

val at : t -> float -> f:( unit -> _ ) -> unit

Create a future that evaluates to () at the given Unix timestamp.

  • raises Stopped

    if the timer was stopped.

exception ExitEvery
val every : ?delay:float -> t -> float -> f:( unit -> _ ) -> unit

every timer n ~f calls f () every n seconds. f() can raise ExitEvery to stop the cycle.

  • parameter delay

    if provided, the first call to f () is delayed by that many seconds.

  • raises Stopped

    if the timer was stopped.

val stop : t -> unit

Stop the given timer, cancelling pending tasks. Idempotent. From now on, calling most other operations on the timer will raise Stopped.

val active : t -> bool

Return true until stop t has been called.

\ No newline at end of file +CCTimer (containers-thread.CCTimer)

Module CCTimer

Event timer

Used to be part of CCFuture.

  • since 0.16
type t

A scheduler for events. It runs in its own thread.

val create : unit -> t

A new timer.

val set_exn_handler : t -> ( exn -> unit ) -> unit

set_exn_handler timer f registers f so that any exception raised by a task scheduled in timer is given to f.

exception Stopped
val after : t -> float -> f:( unit -> _ ) -> unit

Call the callback f after the given number of seconds.

  • raises Stopped

    if the timer was stopped.

val at : t -> float -> f:( unit -> _ ) -> unit

Create a future that evaluates to () at the given Unix timestamp.

  • raises Stopped

    if the timer was stopped.

exception ExitEvery
val every : ?delay:float -> t -> float -> f:( unit -> _ ) -> unit

every timer n ~f calls f () every n seconds. f() can raise ExitEvery to stop the cycle.

  • parameter delay

    if provided, the first call to f () is delayed by that many seconds.

  • raises Stopped

    if the timer was stopped.

val stop : t -> unit

Stop the given timer, cancelling pending tasks. Idempotent. From now on, calling most other operations on the timer will raise Stopped.

val active : t -> bool

Return true until stop t has been called.

\ No newline at end of file diff --git a/dev/containers-thread/index.html b/dev/containers-thread/index.html index 1aef78ae..75068067 100644 --- a/dev/containers-thread/index.html +++ b/dev/containers-thread/index.html @@ -1,2 +1,2 @@ -index (containers-thread.index)

containers-thread index

Library containers-thread

This library exposes the following toplevel modules:

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

containers-thread index

Library containers-thread

This library exposes the following toplevel modules:

\ No newline at end of file diff --git a/dev/containers/CCArray/Floatarray/index.html b/dev/containers/CCArray/Floatarray/index.html index 598fd2b0..cb140abb 100644 --- a/dev/containers/CCArray/Floatarray/index.html +++ b/dev/containers/CCArray/Floatarray/index.html @@ -1,2 +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 +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 index 4394e751..e68b9002 100644 --- a/dev/containers/CCArray/Infix/index.html +++ b/dev/containers/CCArray/Infix/index.html @@ -1,2 +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 +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 a074e100..66c68ce4 100644 --- a/dev/containers/CCArray/index.html +++ b/dev/containers/CCArray/index.html @@ -1,5 +1,5 @@ -CCArray (containers.CCArray)

Module CCArray

Array utils

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

Fast internal iterator.

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

Arrays

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

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

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

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

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

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

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

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

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

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

  • since 0.18
val map_inplace : ( 'a -> 'a ) -> 'a t -> unit

map_inplace f a replace all elements of a by its image by f.

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

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

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

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

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

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

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

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

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

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

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

reverse_in_place a reverses the array a in place.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • returns

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

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

lookup_exn ~cmp key a is like lookup, but

  • raises Not_found

    if the key key is not present.

val bsearch : +CCArray (containers.CCArray)

Module CCArray

Array utils

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

Fast internal iterator.

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

Arrays

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

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

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

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

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

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

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

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

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

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

  • since 0.18
val map_inplace : ( 'a -> 'a ) -> 'a t -> unit

map_inplace f a replace all elements of a by its image by f.

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

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

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

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

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

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

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

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

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

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

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

reverse_in_place a reverses the array a in place.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • returns

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

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

lookup_exn ~cmp key a is like lookup, but

  • raises Not_found

    if the key key is not present.

val bsearch : cmp:( 'a -> 'a -> int ) -> 'a -> 'a t -> diff --git a/dev/containers/CCArray/module-type-MONO_ARRAY/index.html b/dev/containers/CCArray/module-type-MONO_ARRAY/index.html index 9860323f..bed99707 100644 --- a/dev/containers/CCArray/module-type-MONO_ARRAY/index.html +++ b/dev/containers/CCArray/module-type-MONO_ARRAY/index.html @@ -1,2 +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 +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 index 20049907..efc53a15 100644 --- a/dev/containers/CCArrayLabels/Floatarray/index.html +++ b/dev/containers/CCArrayLabels/Floatarray/index.html @@ -1,2 +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 +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 index bf98021b..64e9e797 100644 --- a/dev/containers/CCArrayLabels/Infix/index.html +++ b/dev/containers/CCArrayLabels/Infix/index.html @@ -1,2 +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 +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 ce3623b6..2ea74e70 100644 --- a/dev/containers/CCArrayLabels/index.html +++ b/dev/containers/CCArrayLabels/index.html @@ -1,5 +1,5 @@ -CCArrayLabels (containers.CCArrayLabels)

Module CCArrayLabels

Array utils (Labeled version of CCArray)

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

Fast internal iterator.

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

Arrays

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

Module CCArrayLabels

Array utils (Labeled version of CCArray)

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

Fast internal iterator.

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

Arrays

type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> f:( int -> 'a ) -> 'a array
val make_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val create_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> pos:int -> len:int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> pos:int -> len:int -> 'a -> unit
val blit : src:'a array -> src_pos:int -> dst:'a array -> diff --git a/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html b/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html index 4c27dd6c..1bb842da 100644 --- a/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html +++ b/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html @@ -1,2 +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 +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/CCAtomic/index.html b/dev/containers/CCAtomic/index.html index e1e260b9..4121151b 100644 --- a/dev/containers/CCAtomic/index.html +++ b/dev/containers/CCAtomic/index.html @@ -1,2 +1,2 @@ -CCAtomic (containers.CCAtomic)

Module CCAtomic

include module type of struct include Stdlib.Atomic end
type !'a t = 'a Stdlib__Atomic.t
val make : 'a -> 'a t
val get : 'a t -> 'a
val set : 'a t -> 'a -> unit
val exchange : 'a t -> 'a -> 'a
val compare_and_set : 'a t -> 'a -> 'a -> bool
val fetch_and_add : int t -> int -> int
val incr : int t -> unit
val decr : int t -> unit
\ No newline at end of file +CCAtomic (containers.CCAtomic)

Module CCAtomic

include module type of struct include Stdlib.Atomic end
type !'a t = 'a Stdlib__Atomic.t
val make : 'a -> 'a t
val get : 'a t -> 'a
val set : 'a t -> 'a -> unit
val exchange : 'a t -> 'a -> 'a
val compare_and_set : 'a t -> 'a -> 'a -> bool
val fetch_and_add : int t -> int -> int
val incr : int t -> unit
val decr : int t -> unit
\ No newline at end of file diff --git a/dev/containers/CCBool/index.html b/dev/containers/CCBool/index.html index 3462bd04..fd5f78f2 100644 --- a/dev/containers/CCBool/index.html +++ b/dev/containers/CCBool/index.html @@ -1,2 +1,2 @@ -CCBool (containers.CCBool)

Module CCBool

Basic Bool functions

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

compare b1 b2 is the total ordering on booleans b1 and b2, similar to Stdlib.compare.

val equal : t -> t -> bool

equal b1 b2 is true if b1 and b2 are the same.

val to_int : t -> int

to_int true = 1, to_int false = 0.

  • since 2.7
val of_int : int -> t

of_int i is the same as i <> 0

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

Module CCBool

Basic Bool functions

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

compare b1 b2 is the total ordering on booleans b1 and b2, similar to Stdlib.compare.

val equal : t -> t -> bool

equal b1 b2 is true if b1 and b2 are the same.

val to_int : t -> int

to_int true = 1, to_int false = 0.

  • since 2.7
val of_int : int -> t

of_int i is the same as i <> 0

  • since 2.7
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val pp : t printer
\ No newline at end of file diff --git a/dev/containers/CCByte_buffer/index.html b/dev/containers/CCByte_buffer/index.html index d790ea70..e5ab8062 100644 --- a/dev/containers/CCByte_buffer/index.html +++ b/dev/containers/CCByte_buffer/index.html @@ -1,2 +1,2 @@ -CCByte_buffer (containers.CCByte_buffer)

Module CCByte_buffer

Byte buffer.

A dynamic vector of bytes.

  • since 3.7
type t
type 'a iter = ( 'a -> unit ) -> unit
val create : ?cap:int -> unit -> t

Create a new buffer with given initial capacity.

val length : t -> int

Current length.

val is_empty : t -> bool

is_empty b is length b=0

val capacity : t -> int

Current capacity (size of the array returned by bytes)

val bytes : t -> bytes

Access the underlying byte buffer. This buffer can change after operations that affect the capacity (e.g. add_char).

val clear : t -> unit
val ensure_cap : t -> int -> unit

ensure_cap self n ensures that capacity self >= n.

val shrink_to : t -> int -> unit

shrink_to buf n reduces length buf to at most n. Does nothing if the length is already <= n.

val add_char : t -> char -> unit

Push a character at the end.

val append_bytes : t -> bytes -> unit
val append_subbytes : t -> bytes -> int -> int -> unit
val append_string : t -> string -> unit
val append_substring : t -> string -> int -> int -> unit
val append_buf : t -> Stdlib.Buffer.t -> unit
val append_iter : t -> char iter -> unit
val append_seq : t -> char Stdlib.Seq.t -> unit
val get : t -> int -> char
val unsafe_get : t -> int -> char
val set : t -> int -> char -> unit
val unsafe_set : t -> int -> char -> unit
val contents : t -> string

Copy the internal data to a string

val contents_bytes : t -> bytes

Copy the internal data to a byte buffer

val iter : ( char -> unit ) -> t -> unit
val fold_left : ( 'a -> char -> 'a ) -> 'a -> t -> 'a
val of_iter : char iter -> t
val of_seq : char Stdlib.Seq.t -> t
val to_iter : t -> char iter
val to_seq : t -> char Stdlib.Seq.t
\ No newline at end of file +CCByte_buffer (containers.CCByte_buffer)

Module CCByte_buffer

Byte buffer.

A dynamic vector of bytes.

  • since 3.7
type t
type 'a iter = ( 'a -> unit ) -> unit
val create : ?cap:int -> unit -> t

Create a new buffer with given initial capacity.

val length : t -> int

Current length.

val is_empty : t -> bool

is_empty b is length b=0

val capacity : t -> int

Current capacity (size of the array returned by bytes)

val bytes : t -> bytes

Access the underlying byte buffer. This buffer can change after operations that affect the capacity (e.g. add_char).

val clear : t -> unit
val ensure_cap : t -> int -> unit

ensure_cap self n ensures that capacity self >= n.

val shrink_to : t -> int -> unit

shrink_to buf n reduces length buf to at most n. Does nothing if the length is already <= n.

val add_char : t -> char -> unit

Push a character at the end.

val append_bytes : t -> bytes -> unit
val append_subbytes : t -> bytes -> int -> int -> unit
val append_string : t -> string -> unit
val append_substring : t -> string -> int -> int -> unit
val append_buf : t -> Stdlib.Buffer.t -> unit
val append_iter : t -> char iter -> unit
val append_seq : t -> char Stdlib.Seq.t -> unit
val get : t -> int -> char
val unsafe_get : t -> int -> char
val set : t -> int -> char -> unit
val unsafe_set : t -> int -> char -> unit
val contents : t -> string

Copy the internal data to a string

val contents_bytes : t -> bytes

Copy the internal data to a byte buffer

val iter : ( char -> unit ) -> t -> unit
val fold_left : ( 'a -> char -> 'a ) -> 'a -> t -> 'a
val of_iter : char iter -> t
val of_seq : char Stdlib.Seq.t -> t
val to_iter : t -> char iter
val to_seq : t -> char Stdlib.Seq.t
\ No newline at end of file diff --git a/dev/containers/CCCanonical_sexp/Make/argument-1-Sexp/index.html b/dev/containers/CCCanonical_sexp/Make/argument-1-Sexp/index.html index 78e48f4c..4ea353c3 100644 --- a/dev/containers/CCCanonical_sexp/Make/argument-1-Sexp/index.html +++ b/dev/containers/CCCanonical_sexp/Make/argument-1-Sexp/index.html @@ -1,2 +1,2 @@ -Sexp (containers.CCCanonical_sexp.Make.1-Sexp)

Parameter Make.1-Sexp

type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
\ No newline at end of file +Sexp (containers.CCCanonical_sexp.Make.1-Sexp)

Parameter Make.1-Sexp

type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
\ No newline at end of file diff --git a/dev/containers/CCCanonical_sexp/Make/index.html b/dev/containers/CCCanonical_sexp/Make/index.html index 3b7ef440..fcdaf571 100644 --- a/dev/containers/CCCanonical_sexp/Make/index.html +++ b/dev/containers/CCCanonical_sexp/Make/index.html @@ -1,4 +1,4 @@ -Make (containers.CCCanonical_sexp.Make)

Module CCCanonical_sexp.Make

Parser and printer

Parameters

module Sexp : SEXP

Signature

type t = Sexp.t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : +Make (containers.CCCanonical_sexp.Make)

Module CCCanonical_sexp.Make

Parser and printer

Parameters

module Sexp : SEXP

Signature

type t = Sexp.t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_error
val parse_file : string -> t CCSexp_intf.or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list CCSexp_intf.or_error

Open the file and read a S-exp from it.

\ No newline at end of file diff --git a/dev/containers/CCCanonical_sexp/index.html b/dev/containers/CCCanonical_sexp/index.html index 79a03ed0..ac68c0b9 100644 --- a/dev/containers/CCCanonical_sexp/index.html +++ b/dev/containers/CCCanonical_sexp/index.html @@ -1,4 +1,4 @@ -CCCanonical_sexp (containers.CCCanonical_sexp)

Module CCCanonical_sexp

Canonical S-expressions

See wikipedia. These S-expressions are binary safe.

  • since 3.3
type 'a or_error = ( 'a, string ) Stdlib.result
type 'a gen = unit -> 'a option
module type SEXP = CCSexp_intf.BASIC_SEXP
module type S = CCSexp_intf.S0
module Make (Sexp : SEXP) : S with type t = Sexp.t

Basics

type t = [
| `Atom of string
| `List of t list
]

A simple, structural representation of S-expressions. Compatible with CCSexp.

include S with type t := t
type sexp = t

Re-exports

val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : +CCCanonical_sexp (containers.CCCanonical_sexp)

Module CCCanonical_sexp

Canonical S-expressions

See wikipedia. These S-expressions are binary safe.

  • since 3.3
type 'a or_error = ( 'a, string ) Stdlib.result
type 'a gen = unit -> 'a option
module type SEXP = CCSexp_intf.BASIC_SEXP
module type S = CCSexp_intf.S0
module Make (Sexp : SEXP) : S with type t = Sexp.t

Basics

type t = [
| `Atom of string
| `List of t list
]

A simple, structural representation of S-expressions. Compatible with CCSexp.

include S with type t := t
type sexp = t

Re-exports

val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_error
val parse_file : string -> t CCSexp_intf.or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list CCSexp_intf.or_error

Open the file and read a S-exp from it.

val equal : t -> t -> bool
val compare : t -> t -> int
val atom : string -> t
\ No newline at end of file diff --git a/dev/containers/CCChar/Infix/index.html b/dev/containers/CCChar/Infix/index.html index ee26f7f3..09c6f294 100644 --- a/dev/containers/CCChar/Infix/index.html +++ b/dev/containers/CCChar/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCChar.Infix)

Module CCChar.Infix

val (=) : t -> t -> bool
  • since 3.3
val (<>) : t -> t -> bool
  • since 3.3
val (<) : t -> t -> bool
  • since 3.3
val (>) : t -> t -> bool
  • since 3.3
val (<=) : t -> t -> bool
  • since 3.3
val (>=) : t -> t -> bool
  • since 3.3
\ No newline at end of file +Infix (containers.CCChar.Infix)

Module CCChar.Infix

val (=) : t -> t -> bool
  • since 3.3
val (<>) : t -> t -> bool
  • since 3.3
val (<) : t -> t -> bool
  • since 3.3
val (>) : t -> t -> bool
  • since 3.3
val (<=) : t -> t -> bool
  • since 3.3
val (>=) : t -> t -> bool
  • since 3.3
\ No newline at end of file diff --git a/dev/containers/CCChar/index.html b/dev/containers/CCChar/index.html index 6433e484..20f23b28 100644 --- a/dev/containers/CCChar/index.html +++ b/dev/containers/CCChar/index.html @@ -1,2 +1,2 @@ -CCChar (containers.CCChar)

Module CCChar

Utils around char

  • since 0.14
include module type of struct include Stdlib.Char end
val code : char -> int
val chr : int -> char
val escaped : char -> string
val lowercase : char -> char
val uppercase : char -> char
val lowercase_ascii : char -> char
val uppercase_ascii : char -> char
type t = char
val equal : t -> t -> bool
val unsafe_chr : int -> char
val compare : t -> t -> int

The comparison function for characters, with the same specification as Stdlib.compare. Along with the type t, this function compare allows the module Char to be passed as argument to the functors Set.Make and Map.Make.

val of_int_exn : int -> t

Alias to Char.chr. Return the character with the given ASCII code.

  • raises Invalid_argument

    if the int is not within 0 … 255.

  • since 1.0
val of_int : int -> t option

Safe version of of_int_exn.

  • since 1.0
val to_int : t -> int

Alias to Char.code. Return the ASCII code of the argument.

  • since 1.0
val to_string : t -> string

to_string c returns a string containing c

  • since 2.7
val pp_buf : Stdlib.Buffer.t -> t -> unit

Renamed from pp since 2.0.

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

Renamed from print since 2.0.

Infix Operators

  • since 3.3
module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 3.3
val (<>) : t -> t -> bool
  • since 3.3
val (<) : t -> t -> bool
  • since 3.3
val (>) : t -> t -> bool
  • since 3.3
val (<=) : t -> t -> bool
  • since 3.3
val (>=) : t -> t -> bool
  • since 3.3
\ No newline at end of file +CCChar (containers.CCChar)

Module CCChar

Utils around char

  • since 0.14
include module type of struct include Stdlib.Char end
val code : char -> int
val chr : int -> char
val escaped : char -> string
val lowercase : char -> char
val uppercase : char -> char
val lowercase_ascii : char -> char
val uppercase_ascii : char -> char
type t = char
val equal : t -> t -> bool
val unsafe_chr : int -> char
val compare : t -> t -> int

The comparison function for characters, with the same specification as Stdlib.compare. Along with the type t, this function compare allows the module Char to be passed as argument to the functors Set.Make and Map.Make.

val of_int_exn : int -> t

Alias to Char.chr. Return the character with the given ASCII code.

  • raises Invalid_argument

    if the int is not within 0 … 255.

  • since 1.0
val of_int : int -> t option

Safe version of of_int_exn.

  • since 1.0
val to_int : t -> int

Alias to Char.code. Return the ASCII code of the argument.

  • since 1.0
val to_string : t -> string

to_string c returns a string containing c

  • since 2.7
val pp_buf : Stdlib.Buffer.t -> t -> unit

Renamed from pp since 2.0.

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

Renamed from print since 2.0.

Infix Operators

  • since 3.3
module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 3.3
val (<>) : t -> t -> bool
  • since 3.3
val (<) : t -> t -> bool
  • since 3.3
val (>) : t -> t -> bool
  • since 3.3
val (<=) : t -> t -> bool
  • since 3.3
val (>=) : t -> t -> bool
  • since 3.3
\ No newline at end of file diff --git a/dev/containers/CCEither/index.html b/dev/containers/CCEither/index.html index ec735569..c906189a 100644 --- a/dev/containers/CCEither/index.html +++ b/dev/containers/CCEither/index.html @@ -1,5 +1,5 @@ -CCEither (containers.CCEither)

Module CCEither

Either Monad

Module that is compatible with Either form OCaml 4.12 but can be use with any ocaml version compatible with container

  • since 3.2
type 'a iter = ( 'a -> unit ) -> unit
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type ('a, 'b) t = ( 'a, 'b ) Either.t =
| Left of 'a
| Right of 'b
val left : 'a -> ( 'a, 'b ) t

left l is Left l

val right : 'b -> ( 'a, 'b ) t

right r is Right r

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

is_left x checks if x = Left _

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

is_right x checks if x = Right _

val find_left : ( 'a, 'b ) t -> 'a option

find_left x returns l if x = Left l and None otherwise.

val find_right : ( 'a, 'b ) t -> 'b option

find_right x returns r if x = Left r and None otherwise.

val map_left : ( 'a1 -> 'a2 ) -> ( 'a1, 'b ) t -> ( 'a2, 'b ) t

Map of the Left variant.

val map_right : ( 'b1 -> 'b2 ) -> ( 'a, 'b1 ) t -> ( 'a, 'b2 ) t

Map of the Right variant.

val map : +CCEither (containers.CCEither)

Module CCEither

Either Monad

Module that is compatible with Either form OCaml 4.12 but can be use with any ocaml version compatible with container

  • since 3.2
type 'a iter = ( 'a -> unit ) -> unit
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type ('a, 'b) t = ( 'a, 'b ) Either.t =
| Left of 'a
| Right of 'b
val left : 'a -> ( 'a, 'b ) t

left l is Left l

val right : 'b -> ( 'a, 'b ) t

right r is Right r

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

is_left x checks if x = Left _

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

is_right x checks if x = Right _

val find_left : ( 'a, 'b ) t -> 'a option

find_left x returns l if x = Left l and None otherwise.

val find_right : ( 'a, 'b ) t -> 'b option

find_right x returns r if x = Left r and None otherwise.

val map_left : ( 'a1 -> 'a2 ) -> ( 'a1, 'b ) t -> ( 'a2, 'b ) t

Map of the Left variant.

val map_right : ( 'b1 -> 'b2 ) -> ( 'a, 'b1 ) t -> ( 'a, 'b2 ) t

Map of the Right variant.

val map : left:( 'a1 -> 'a2 ) -> right:( 'b1 -> 'b2 ) -> ( 'a1, 'b1 ) t -> diff --git a/dev/containers/CCEqual/Infix/index.html b/dev/containers/CCEqual/Infix/index.html index 465d90ce..2dbfcb39 100644 --- a/dev/containers/CCEqual/Infix/index.html +++ b/dev/containers/CCEqual/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCEqual.Infix)

Module CCEqual.Infix

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

Infix equivalent of map.

\ No newline at end of file +Infix (containers.CCEqual.Infix)

Module CCEqual.Infix

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

Infix equivalent of map.

\ No newline at end of file diff --git a/dev/containers/CCEqual/index.html b/dev/containers/CCEqual/index.html index 324a35f7..d4a7409e 100644 --- a/dev/containers/CCEqual/index.html +++ b/dev/containers/CCEqual/index.html @@ -1,2 +1,2 @@ -CCEqual (containers.CCEqual)

Module CCEqual

Equality Combinators

  • since 1.2
type 'a t = 'a -> 'a -> bool

Equality function. Must be transitive, symmetric, and reflexive.

val poly : 'a t

Standard polymorphic equality.

val physical : 'a t

Standard physical equality.

  • since 2.0
val int : int t
val string : string t
val bool : bool t
val float : float t
val unit : unit t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val option : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val map : ( 'a -> 'b ) -> 'b t -> 'a t

map f eq is the equality function that, given objects x and y, projects x and y using f (e.g. using a record field) and then compares those projections with eq. Example: map fst int compares values of type (int * 'a) by their first component.

val always_eq : _ t

Always returns true. All values are equal.

  • since 3.0
val never_eq : _ t

Always returns false. No values are, so this is not even reflexive (i.e. x=x is false). Be careful!

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

Infix equivalent of map.

\ No newline at end of file +CCEqual (containers.CCEqual)

Module CCEqual

Equality Combinators

  • since 1.2
type 'a t = 'a -> 'a -> bool

Equality function. Must be transitive, symmetric, and reflexive.

val poly : 'a t

Standard polymorphic equality.

val physical : 'a t

Standard physical equality.

  • since 2.0
val int : int t
val string : string t
val bool : bool t
val float : float t
val unit : unit t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val option : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val map : ( 'a -> 'b ) -> 'b t -> 'a t

map f eq is the equality function that, given objects x and y, projects x and y using f (e.g. using a record field) and then compares those projections with eq. Example: map fst int compares values of type (int * 'a) by their first component.

val always_eq : _ t

Always returns true. All values are equal.

  • since 3.0
val never_eq : _ t

Always returns false. No values are, so this is not even reflexive (i.e. x=x is false). Be careful!

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

Infix equivalent of map.

\ No newline at end of file diff --git a/dev/containers/CCEqualLabels/Infix/index.html b/dev/containers/CCEqualLabels/Infix/index.html index b68f9e7b..020e5e57 100644 --- a/dev/containers/CCEqualLabels/Infix/index.html +++ b/dev/containers/CCEqualLabels/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCEqualLabels.Infix)

Module CCEqualLabels.Infix

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

Infix equivalent of map.

\ No newline at end of file +Infix (containers.CCEqualLabels.Infix)

Module CCEqualLabels.Infix

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

Infix equivalent of map.

\ No newline at end of file diff --git a/dev/containers/CCEqualLabels/index.html b/dev/containers/CCEqualLabels/index.html index 80c668f4..99245474 100644 --- a/dev/containers/CCEqualLabels/index.html +++ b/dev/containers/CCEqualLabels/index.html @@ -1,2 +1,2 @@ -CCEqualLabels (containers.CCEqualLabels)

Module CCEqualLabels

Equality Combinators (Labeled version of CCEqual)

  • since 1.2
type 'a t = 'a -> 'a -> bool

Equality function. Must be transitive, symmetric, and reflexive.

val poly : 'a t

Standard polymorphic equality.

val physical : 'a t

Standard physical equality.

  • since 2.0
val int : int t
val string : string t
val bool : bool t
val float : float t
val unit : unit t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val option : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val map : f:( 'a -> 'b ) -> 'b t -> 'a t

map f eq is the equality function that, given objects x and y, projects x and y using f (e.g. using a record field) and then compares those projections with eq. Example: map fst int compares values of type (int * 'a) by their first component.

val always_eq : _ t

Always returns true. All values are equal.

  • since NEXT_RELEASE
val never_eq : _ t

Always returns false. No values are, so this is not even reflexive (i.e. x=x is false). Be careful!

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

Infix equivalent of map.

\ No newline at end of file +CCEqualLabels (containers.CCEqualLabels)

Module CCEqualLabels

Equality Combinators (Labeled version of CCEqual)

  • since 1.2
type 'a t = 'a -> 'a -> bool

Equality function. Must be transitive, symmetric, and reflexive.

val poly : 'a t

Standard polymorphic equality.

val physical : 'a t

Standard physical equality.

  • since 2.0
val int : int t
val string : string t
val bool : bool t
val float : float t
val unit : unit t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val option : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val map : f:( 'a -> 'b ) -> 'b t -> 'a t

map f eq is the equality function that, given objects x and y, projects x and y using f (e.g. using a record field) and then compares those projections with eq. Example: map fst int compares values of type (int * 'a) by their first component.

val always_eq : _ t

Always returns true. All values are equal.

  • since NEXT_RELEASE
val never_eq : _ t

Always returns false. No values are, so this is not even reflexive (i.e. x=x is false). Be careful!

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

Infix equivalent of map.

\ No newline at end of file diff --git a/dev/containers/CCFloat/Infix/index.html b/dev/containers/CCFloat/Infix/index.html index ebea54a7..bfd8d974 100644 --- a/dev/containers/CCFloat/Infix/index.html +++ b/dev/containers/CCFloat/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCFloat.Infix)

Module CCFloat.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

Addition.

  • since 2.1
val (-) : t -> t -> t

Subtraction.

  • since 2.1
val (~-) : t -> t

Unary negation.

  • since 2.1
val (*) : t -> t -> t

Multiplication.

  • since 2.1
val (/) : t -> t -> t

Division.

  • since 2.1
\ No newline at end of file +Infix (containers.CCFloat.Infix)

Module CCFloat.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

Addition.

  • since 2.1
val (-) : t -> t -> t

Subtraction.

  • since 2.1
val (~-) : t -> t

Unary negation.

  • since 2.1
val (*) : t -> t -> t

Multiplication.

  • since 2.1
val (/) : t -> t -> t

Division.

  • since 2.1
\ No newline at end of file diff --git a/dev/containers/CCFloat/index.html b/dev/containers/CCFloat/index.html index d0faa8c8..f2a40280 100644 --- a/dev/containers/CCFloat/index.html +++ b/dev/containers/CCFloat/index.html @@ -1,2 +1,2 @@ -CCFloat (containers.CCFloat)

Module CCFloat

Basic operations on floating-point numbers

  • since 0.6.1
type t = float
type fpclass = CCShims_.Stdlib.fpclass =
| FP_normal
| FP_subnormal
| FP_zero
| FP_infinite
| FP_nan
val nan : t

nan is Not a Number (NaN). Equal to Stdlib.nan.

val max_value : t

max_value is Positive infinity. Equal to Stdlib.infinity.

val min_value : t

min_value is Negative infinity. Equal to Stdlib.neg_infinity.

val max_finite_value : t

max_finite_value is the largest finite float value. Equal to Stdlib.max_float.

val epsilon : t

epsilon is the smallest positive float x such that 1.0 +. x <> 1.0. Equal to Stdlib.epsilon_float.

val pi : t

pi is the constant pi. The ratio of a circumference to its diameter.

  • since 3.0
val is_nan : t -> bool

is_nan f returns true if f is NaN, false otherwise.

val add : t -> t -> t

add x y is equal to x +. y.

val sub : t -> t -> t

sub x y is equal to x -. y.

val neg : t -> t

neg x is equal to ~-. x.

val abs : t -> t

abs x is the absolute value of the floating-point number x. Equal to Stdlib.abs_float.

val scale : t -> t -> t

scale x y is equal to x *. y.

val min : t -> t -> t

min x y returns the min of the two given values x and y.

val max : t -> t -> t

max x y returns the max of the two given values x and y.

val equal : t -> t -> bool

equal x y is true if x and y are the same.

val compare : t -> t -> int

compare x y is Stdlib.comparexy.

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val pp : t printer
val hash : t -> int
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen
val fsign : t -> t

fsign x is one of -1., -0., +0., +1., or nan if x is NaN.

  • since 0.7
val round : t -> t

round x returns the closest integer value, either above or below. For n + 0.5, round returns n.

  • since 0.20
exception TrapNaN of string
val sign_exn : t -> int

sign_exn x will return the sign of x as 1, 0 or -1, or raise an exception TrapNaN if x is NaN. Note that infinities have defined signs in OCaml.

  • since 0.7
val to_int : t -> int

Alias to int_of_float. Unspecified if outside of the range of integers.

val of_int : int -> t

Alias to float_of_int.

val to_string : t -> string
val of_string_exn : string -> t

Alias to float_of_string.

  • raises Failure

    in case of failure.

  • since 1.2
val of_string_opt : string -> t option
  • since 3.0
val equal_precision : epsilon:t -> t -> t -> bool

Equality with allowed error up to a non negative epsilon value.

val classify : t -> fpclass

classify x returns the class of the given floating-point number x: normal, subnormal, zero, infinite or nan (not a number).

Infix Operators

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

Addition.

  • since 2.1
val (-) : t -> t -> t

Subtraction.

  • since 2.1
val (~-) : t -> t

Unary negation.

  • since 2.1
val (*) : t -> t -> t

Multiplication.

  • since 2.1
val (/) : t -> t -> t

Division.

  • since 2.1
\ No newline at end of file +CCFloat (containers.CCFloat)

Module CCFloat

Basic operations on floating-point numbers

  • since 0.6.1
type t = float
type fpclass = CCShims_.Stdlib.fpclass =
| FP_normal
| FP_subnormal
| FP_zero
| FP_infinite
| FP_nan
val nan : t

nan is Not a Number (NaN). Equal to Stdlib.nan.

val max_value : t

max_value is Positive infinity. Equal to Stdlib.infinity.

val min_value : t

min_value is Negative infinity. Equal to Stdlib.neg_infinity.

val max_finite_value : t

max_finite_value is the largest finite float value. Equal to Stdlib.max_float.

val epsilon : t

epsilon is the smallest positive float x such that 1.0 +. x <> 1.0. Equal to Stdlib.epsilon_float.

val pi : t

pi is the constant pi. The ratio of a circumference to its diameter.

  • since 3.0
val is_nan : t -> bool

is_nan f returns true if f is NaN, false otherwise.

val add : t -> t -> t

add x y is equal to x +. y.

val sub : t -> t -> t

sub x y is equal to x -. y.

val neg : t -> t

neg x is equal to ~-. x.

val abs : t -> t

abs x is the absolute value of the floating-point number x. Equal to Stdlib.abs_float.

val scale : t -> t -> t

scale x y is equal to x *. y.

val min : t -> t -> t

min x y returns the min of the two given values x and y.

val max : t -> t -> t

max x y returns the max of the two given values x and y.

val equal : t -> t -> bool

equal x y is true if x and y are the same.

val compare : t -> t -> int

compare x y is Stdlib.comparexy.

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val pp : t printer
val hash : t -> int
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen
val fsign : t -> t

fsign x is one of -1., -0., +0., +1., or nan if x is NaN.

  • since 0.7
val round : t -> t

round x returns the closest integer value, either above or below. For n + 0.5, round returns n.

  • since 0.20
exception TrapNaN of string
val sign_exn : t -> int

sign_exn x will return the sign of x as 1, 0 or -1, or raise an exception TrapNaN if x is NaN. Note that infinities have defined signs in OCaml.

  • since 0.7
val to_int : t -> int

Alias to int_of_float. Unspecified if outside of the range of integers.

val of_int : int -> t

Alias to float_of_int.

val to_string : t -> string
val of_string_exn : string -> t

Alias to float_of_string.

  • raises Failure

    in case of failure.

  • since 1.2
val of_string_opt : string -> t option
  • since 3.0
val equal_precision : epsilon:t -> t -> t -> bool

Equality with allowed error up to a non negative epsilon value.

val classify : t -> fpclass

classify x returns the class of the given floating-point number x: normal, subnormal, zero, infinite or nan (not a number).

Infix Operators

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

Addition.

  • since 2.1
val (-) : t -> t -> t

Subtraction.

  • since 2.1
val (~-) : t -> t

Unary negation.

  • since 2.1
val (*) : t -> t -> t

Multiplication.

  • since 2.1
val (/) : t -> t -> t

Division.

  • since 2.1
\ No newline at end of file diff --git a/dev/containers/CCFormat/ANSI_codes/index.html b/dev/containers/CCFormat/ANSI_codes/index.html index 20bbefbd..ed73ac54 100644 --- a/dev/containers/CCFormat/ANSI_codes/index.html +++ b/dev/containers/CCFormat/ANSI_codes/index.html @@ -1,3 +1,3 @@ -ANSI_codes (containers.CCFormat.ANSI_codes)

Module CCFormat.ANSI_codes

ANSI escape codes. This contains lower level functions for them.

  • since 3.5
type color = [
| `Black
| `Red
| `Yellow
| `Green
| `Blue
| `Magenta
| `Cyan
| `White
]

An ANSI color

type style = [
| `FG of color(*

foreground

*)
| `BG of color(*

background

*)
| `Bold
| `Reset
]

A style. Styles can be composed in a list.

val clear_line : string

clear_line is an escape code to clear the current line. It is very useful for progress bars; for example:

let pp_progress i =
+ANSI_codes (containers.CCFormat.ANSI_codes)

Module CCFormat.ANSI_codes

ANSI escape codes. This contains lower level functions for them.

  • since 3.5
type color = [
| `Black
| `Red
| `Yellow
| `Green
| `Blue
| `Magenta
| `Cyan
| `White
]

An ANSI color

type style = [
| `FG of color(*

foreground

*)
| `BG of color(*

background

*)
| `Bold
| `Reset
]

A style. Styles can be composed in a list.

val clear_line : string

clear_line is an escape code to clear the current line. It is very useful for progress bars; for example:

let pp_progress i =
   Printf.printf "%sprogress at %d%!" ANSI_codes.clear_line i

if called repeatedly this will print successive progress messages on a single line.

val reset : string

The escape code to reset style (colors, bold, etc.)

val string_of_style : style -> string

string_of_style st is an escape code to set the current style to st. It can be printed as is on any output that is a compatible terminal.

val string_of_style_list : style list -> string

string_of_style_list styles is an escape code for multiple styles at once. For example string_of_style_list ANSI_codes.([`FG `Red; `BG `Green; `Bold]) is a very shiny style.

\ No newline at end of file diff --git a/dev/containers/CCFormat/Dump/index.html b/dev/containers/CCFormat/Dump/index.html index 8fe65078..f9762c52 100644 --- a/dev/containers/CCFormat/Dump/index.html +++ b/dev/containers/CCFormat/Dump/index.html @@ -1,2 +1,2 @@ -Dump (containers.CCFormat.Dump)

Module CCFormat.Dump

type 'a t = 'a printer
val unit : unit t
val int : int t
val string : string t
val bool : bool t
val float : float t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val option : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t
val result : 'a t -> ( 'a, string ) Stdlib.result t
val result' : 'a t -> 'e t -> ( 'a, 'e ) Stdlib.result t
val to_string : 'a t -> 'a -> string
\ No newline at end of file +Dump (containers.CCFormat.Dump)

Module CCFormat.Dump

type 'a t = 'a printer
val unit : unit t
val int : int t
val string : string t
val bool : bool t
val float : float t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val option : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t
val result : 'a t -> ( 'a, string ) Stdlib.result t
val result' : 'a t -> 'e t -> ( 'a, 'e ) Stdlib.result t
val to_string : 'a t -> 'a -> string
\ No newline at end of file diff --git a/dev/containers/CCFormat/Infix/index.html b/dev/containers/CCFormat/Infix/index.html index bcd5d175..b2e86e37 100644 --- a/dev/containers/CCFormat/Infix/index.html +++ b/dev/containers/CCFormat/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCFormat.Infix)

Module CCFormat.Infix

val (++) : unit printer -> unit printer -> unit printer

Alias to append.

  • since 3.2
\ No newline at end of file +Infix (containers.CCFormat.Infix)

Module CCFormat.Infix

val (++) : unit printer -> unit printer -> unit printer

Alias to append.

  • since 3.2
\ No newline at end of file diff --git a/dev/containers/CCFormat/index.html b/dev/containers/CCFormat/index.html index 749b1ba5..096fd1d6 100644 --- a/dev/containers/CCFormat/index.html +++ b/dev/containers/CCFormat/index.html @@ -1,5 +1,5 @@ -CCFormat (containers.CCFormat)

Module CCFormat

Helpers for Format

  • since 0.8
type 'a iter = ( 'a -> unit ) -> unit
include module type of struct include Stdlib.Format end
type formatter = Stdlib__Format.formatter
val pp_open_box : formatter -> int -> unit
val open_box : int -> unit
val pp_close_box : formatter -> unit -> unit
val close_box : unit -> unit
val pp_open_hbox : formatter -> unit -> unit
val open_hbox : unit -> unit
val pp_open_vbox : formatter -> int -> unit
val open_vbox : int -> unit
val pp_open_hvbox : formatter -> int -> unit
val open_hvbox : int -> unit
val pp_open_hovbox : formatter -> int -> unit
val open_hovbox : int -> unit
val pp_print_string : formatter -> string -> unit
val print_string : string -> unit
val pp_print_bytes : formatter -> bytes -> unit
val print_bytes : bytes -> unit
val pp_print_as : formatter -> int -> string -> unit
val print_as : int -> string -> unit
val pp_print_int : formatter -> int -> unit
val print_int : int -> unit
val pp_print_float : formatter -> float -> unit
val print_float : float -> unit
val pp_print_char : formatter -> char -> unit
val print_char : char -> unit
val pp_print_bool : formatter -> bool -> unit
val print_bool : bool -> unit
val pp_print_space : formatter -> unit -> unit
val print_space : unit -> unit
val pp_print_cut : formatter -> unit -> unit
val print_cut : unit -> unit
val pp_print_break : formatter -> int -> int -> unit
val print_break : int -> int -> unit
val pp_print_custom_break : +CCFormat (containers.CCFormat)

Module CCFormat

Helpers for Format

  • since 0.8
type 'a iter = ( 'a -> unit ) -> unit
include module type of struct include Stdlib.Format end
type formatter = Stdlib__Format.formatter
val pp_open_box : formatter -> int -> unit
val open_box : int -> unit
val pp_close_box : formatter -> unit -> unit
val close_box : unit -> unit
val pp_open_hbox : formatter -> unit -> unit
val open_hbox : unit -> unit
val pp_open_vbox : formatter -> int -> unit
val open_vbox : int -> unit
val pp_open_hvbox : formatter -> int -> unit
val open_hvbox : int -> unit
val pp_open_hovbox : formatter -> int -> unit
val open_hovbox : int -> unit
val pp_print_string : formatter -> string -> unit
val print_string : string -> unit
val pp_print_bytes : formatter -> bytes -> unit
val print_bytes : bytes -> unit
val pp_print_as : formatter -> int -> string -> unit
val print_as : int -> string -> unit
val pp_print_int : formatter -> int -> unit
val print_int : int -> unit
val pp_print_float : formatter -> float -> unit
val print_float : float -> unit
val pp_print_char : formatter -> char -> unit
val print_char : char -> unit
val pp_print_bool : formatter -> bool -> unit
val print_bool : bool -> unit
val pp_print_space : formatter -> unit -> unit
val print_space : unit -> unit
val pp_print_cut : formatter -> unit -> unit
val print_cut : unit -> unit
val pp_print_break : formatter -> int -> int -> unit
val print_break : int -> int -> unit
val pp_print_custom_break : formatter -> fits:(string * int * string) -> breaks:(string * int * string) -> diff --git a/dev/containers/CCFun/Infix/index.html b/dev/containers/CCFun/Infix/index.html index d0db4a09..b4fb735c 100644 --- a/dev/containers/CCFun/Infix/index.html +++ b/dev/containers/CCFun/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCFun.Infix)

Module CCFun.Infix

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

x |> f is the same as f x. A 'pipe' operator.

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

f @@ x is the same as f x, but right-associative.

  • since 0.5
val (%>) : ( 'a -> 'b ) -> ( 'b -> 'c ) -> 'a -> 'c

(f %> g) x or (%>) f g x is g (f x). Alias to compose.

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

(f % g) x or (%) f g x is f (g x). Mathematical composition.

\ No newline at end of file +Infix (containers.CCFun.Infix)

Module CCFun.Infix

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

x |> f is the same as f x. A 'pipe' operator.

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

f @@ x is the same as f x, but right-associative.

  • since 0.5
val (%>) : ( 'a -> 'b ) -> ( 'b -> 'c ) -> 'a -> 'c

(f %> g) x or (%>) f g x is g (f x). Alias to compose.

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

(f % g) x or (%) f g x is f (g x). Mathematical composition.

\ No newline at end of file diff --git a/dev/containers/CCFun/Monad/argument-1-X/index.html b/dev/containers/CCFun/Monad/argument-1-X/index.html index d1fee256..89264d19 100644 --- a/dev/containers/CCFun/Monad/argument-1-X/index.html +++ b/dev/containers/CCFun/Monad/argument-1-X/index.html @@ -1,2 +1,2 @@ -X (containers.CCFun.Monad.1-X)

Parameter Monad.1-X

type t
\ No newline at end of file +X (containers.CCFun.Monad.1-X)

Parameter Monad.1-X

type t
\ No newline at end of file diff --git a/dev/containers/CCFun/Monad/index.html b/dev/containers/CCFun/Monad/index.html index 50ce200f..6133a9d5 100644 --- a/dev/containers/CCFun/Monad/index.html +++ b/dev/containers/CCFun/Monad/index.html @@ -1,2 +1,2 @@ -Monad (containers.CCFun.Monad)

Module CCFun.Monad

Parameters

module X : sig ... end

Signature

type 'a t = X.t -> 'a
val return : 'a -> 'a t

Monadic return.

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

Monadic bind.

\ No newline at end of file +Monad (containers.CCFun.Monad)

Module CCFun.Monad

Parameters

module X : sig ... end

Signature

type 'a t = X.t -> 'a
val return : 'a -> 'a t

Monadic return.

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

Monadic bind.

\ No newline at end of file diff --git a/dev/containers/CCFun/index.html b/dev/containers/CCFun/index.html index bdd28b42..a579dd9f 100644 --- a/dev/containers/CCFun/index.html +++ b/dev/containers/CCFun/index.html @@ -1,5 +1,5 @@ -CCFun (containers.CCFun)

Module CCFun

Basic operations on Functions

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

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

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

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

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

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

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

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

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

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

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

Module CCFun

Basic operations on Functions

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

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

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

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

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

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

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

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

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

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

CCArray.(1 -- 10)
 |> tap CCArray.shuffle
 |> tap @@ CCArray.sort Stdlib.compare
val lexicographic : ( 'a -> 'a -> int ) -> diff --git a/dev/containers/CCHash/index.html b/dev/containers/CCHash/index.html index c3e4c95b..10c15c64 100644 --- a/dev/containers/CCHash/index.html +++ b/dev/containers/CCHash/index.html @@ -1,4 +1,4 @@ -CCHash (containers.CCHash)

Module CCHash

Hash combinators

The API of this module is stable as per semantic versioning, like the rest of containers. However the exact implementation of hashing function can change and should not be relied on (i.e. hashing a value always returns the same integer within a run of a program, not across versions of OCaml and Containers).

Definitions

type hash = int

A hash value is a positive integer.

type 'a t = 'a -> hash

A hash function for values of type 'a.

val const : hash -> _ t

const h hashes any value into h. Use with caution!.

val const0 : _ t

Always return 0. Useful for ignoring elements. Example: Hash.(pair string const0) will map pairs ("a", 1) and ("a", 2) to the same hash, but not the same as ("b", 1).

  • since 1.5
val int : int t
val bool : bool t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val slice : string -> int -> int t

slice s i len state hashes the slice i, …, i+len-1 of s into state.

val bytes : bytes t

Hash a byte array.

  • since 3.5
val string : string t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val opt : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t
val map : ( 'a -> 'b ) -> 'b t -> 'a t

map f h is the hasher that takes x, and uses h to hash f x.

For example:

module Str_set = Set.Make(String)
+CCHash (containers.CCHash)

Module CCHash

Hash combinators

The API of this module is stable as per semantic versioning, like the rest of containers. However the exact implementation of hashing function can change and should not be relied on (i.e. hashing a value always returns the same integer within a run of a program, not across versions of OCaml and Containers).

Definitions

type hash = int

A hash value is a positive integer.

type 'a t = 'a -> hash

A hash function for values of type 'a.

val const : hash -> _ t

const h hashes any value into h. Use with caution!.

val const0 : _ t

Always return 0. Useful for ignoring elements. Example: Hash.(pair string const0) will map pairs ("a", 1) and ("a", 2) to the same hash, but not the same as ("b", 1).

  • since 1.5
val int : int t
val bool : bool t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val slice : string -> int -> int t

slice s i len state hashes the slice i, …, i+len-1 of s into state.

val bytes : bytes t

Hash a byte array.

  • since 3.5
val string : string t
val list : 'a t -> 'a list t
val array : 'a t -> 'a array t
val opt : 'a t -> 'a option t
val pair : 'a t -> 'b t -> ('a * 'b) t
val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t
val map : ( 'a -> 'b ) -> 'b t -> 'a t

map f h is the hasher that takes x, and uses h to hash f x.

For example:

module Str_set = Set.Make(String)
 
 let hash_str_set : Str_set.t CCHash.t = CCHash.(map Str_set.to_seq @@ seq string)
  • since 3.5
val if_ : bool -> 'a t -> 'a t -> 'a t

Decide which hash function to use depending on the boolean.

val poly : 'a t

poly x is Hashtbl.hash x. The regular polymorphic hash function.

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

Commutative version of list. Lists that are equal up to permutation will have the same hash.

  • since 1.0
val array_comm : 'a t -> 'a array t

Commutative version of array. Arrays that are equal up to permutation will have the same hash.

  • since 1.0

Base hash combinators

val combine : 'a t -> hash -> 'a -> hash
val combine2 : hash -> hash -> hash
val combine3 : hash -> hash -> hash -> hash
val combine4 : hash -> hash -> hash -> hash -> hash
val combine5 : hash -> hash -> hash -> hash -> hash -> hash
  • since 2.1
val combine6 : hash -> hash -> hash -> hash -> hash -> hash -> hash
  • since 2.1

Iterators

type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
val seq : 'a t -> 'a Stdlib.Seq.t t
val iter : 'a t -> 'a iter t
val gen : 'a t -> 'a gen t
\ No newline at end of file diff --git a/dev/containers/CCHashtbl/Make/index.html b/dev/containers/CCHashtbl/Make/index.html index b2735007..2be6989f 100644 --- a/dev/containers/CCHashtbl/Make/index.html +++ b/dev/containers/CCHashtbl/Make/index.html @@ -1,5 +1,5 @@ -Make (containers.CCHashtbl.Make)

Module CCHashtbl.Make

Parameters

module X : Stdlib.Hashtbl.HashedType

Signature

include Stdlib.Hashtbl.S +Make (containers.CCHashtbl.Make)

Module CCHashtbl.Make

Parameters

module X : Stdlib.Hashtbl.HashedType

Signature

include Stdlib.Hashtbl.S with type key = X.t with type 'a t = 'a Stdlib.Hashtbl.Make(X).t
type key = X.t
type 'a t = 'a Stdlib.Hashtbl.Make(X).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 replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val get : 'a t -> key -> 'a 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 t -> key -> default:'a -> 'a

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 add_list : 'a list t -> key -> 'a -> 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 incr : ?by:int -> int t -> key -> 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 -> int t -> key -> 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 keys : 'a t -> key iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : 'a t -> 'a iter

values tbl f iterates on values in the table.

val keys_list : _ t -> key 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 t -> 'a list

values_list t is the list of values in t.

  • since 0.8
val map_list : ( key -> 'a -> 'b ) -> 'a t -> 'b list

Map on a hashtable's items, collect into a list.

val to_iter : 'a t -> (key * 'a) iter

Iterate on bindings in the table.

  • since 2.8
val add_iter : 'a t -> (key * 'a) iter -> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • since 2.8
val add_iter_with : f:( key -> 'a -> 'a -> 'a ) -> diff --git a/dev/containers/CCHashtbl/Poly/index.html b/dev/containers/CCHashtbl/Poly/index.html index a6abfb61..1df34bdd 100644 --- a/dev/containers/CCHashtbl/Poly/index.html +++ b/dev/containers/CCHashtbl/Poly/index.html @@ -1,5 +1,5 @@ -Poly (containers.CCHashtbl.Poly)

Module CCHashtbl.Poly

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 iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b 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) 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) iter -> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • since 2.8
val add_iter_with : +Poly (containers.CCHashtbl.Poly)

Module CCHashtbl.Poly

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 iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b 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) 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) 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) iter -> diff --git a/dev/containers/CCHashtbl/index.html b/dev/containers/CCHashtbl/index.html index 3e944892..5b373f4d 100644 --- a/dev/containers/CCHashtbl/index.html +++ b/dev/containers/CCHashtbl/index.html @@ -1,5 +1,5 @@ -CCHashtbl (containers.CCHashtbl)

Module CCHashtbl

Extension to the standard Hashtbl

  • since 0.4
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a eq = 'a -> 'a -> bool
type 'a hash = 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Polymorphic tables

This sub-module contains the extension of the standard polymorphic Hashtbl.

module Poly : sig ... end
include module type of Poly
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 iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b 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) 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) iter -> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • since 2.8
val add_iter_with : +CCHashtbl (containers.CCHashtbl)

Module CCHashtbl

Extension to the standard Hashtbl

  • since 0.4
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a eq = 'a -> 'a -> bool
type 'a hash = 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Polymorphic tables

This sub-module contains the extension of the standard polymorphic Hashtbl.

module Poly : sig ... end
include module type of Poly
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 iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b 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) 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) 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) iter -> diff --git a/dev/containers/CCHashtbl/module-type-S/index.html b/dev/containers/CCHashtbl/module-type-S/index.html index 055b0bff..211cbc52 100644 --- a/dev/containers/CCHashtbl/module-type-S/index.html +++ b/dev/containers/CCHashtbl/module-type-S/index.html @@ -1,5 +1,5 @@ -S (containers.CCHashtbl.S)

Module type CCHashtbl.S

include Stdlib.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 -> 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 replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val get : 'a t -> key -> 'a 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 t -> key -> default:'a -> 'a

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 add_list : 'a list t -> key -> 'a -> 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 incr : ?by:int -> int t -> key -> 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 -> int t -> key -> 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 keys : 'a t -> key iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : 'a t -> 'a iter

values tbl f iterates on values in the table.

val keys_list : _ t -> key 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 t -> 'a list

values_list t is the list of values in t.

  • since 0.8
val map_list : ( key -> 'a -> 'b ) -> 'a t -> 'b list

Map on a hashtable's items, collect into a list.

val to_iter : 'a t -> (key * 'a) iter

Iterate on bindings in the table.

  • since 2.8
val add_iter : 'a t -> (key * 'a) iter -> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • since 2.8
val add_iter_with : +S (containers.CCHashtbl.S)

Module type CCHashtbl.S

include Stdlib.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 -> 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 replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val get : 'a t -> key -> 'a 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 t -> key -> default:'a -> 'a

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 add_list : 'a list t -> key -> 'a -> 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 incr : ?by:int -> int t -> key -> 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 -> int t -> key -> 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 keys : 'a t -> key iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : 'a t -> 'a iter

values tbl f iterates on values in the table.

val keys_list : _ t -> key 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 t -> 'a list

values_list t is the list of values in t.

  • since 0.8
val map_list : ( key -> 'a -> 'b ) -> 'a t -> 'b list

Map on a hashtable's items, collect into a list.

val to_iter : 'a t -> (key * 'a) iter

Iterate on bindings in the table.

  • since 2.8
val add_iter : 'a t -> (key * 'a) iter -> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • since 2.8
val add_iter_with : f:( key -> 'a -> 'a -> 'a ) -> 'a t -> (key * 'a) iter -> diff --git a/dev/containers/CCHeap/Make/argument-1-E/index.html b/dev/containers/CCHeap/Make/argument-1-E/index.html index ed3e7a3d..2d25179a 100644 --- a/dev/containers/CCHeap/Make/argument-1-E/index.html +++ b/dev/containers/CCHeap/Make/argument-1-E/index.html @@ -1,2 +1,2 @@ -E (containers.CCHeap.Make.1-E)

Parameter Make.1-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 +E (containers.CCHeap.Make.1-E)

Parameter Make.1-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 index bd031dab..d239a259 100644 --- a/dev/containers/CCHeap/Make/index.html +++ b/dev/containers/CCHeap/Make/index.html @@ -1,5 +1,5 @@ -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 : +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 -> 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 index ee7a9bd2..d2f3a329 100644 --- a/dev/containers/CCHeap/Make_from_compare/argument-1-E/index.html +++ b/dev/containers/CCHeap/Make_from_compare/argument-1-E/index.html @@ -1,2 +1,2 @@ -E (containers.CCHeap.Make_from_compare.1-E)

Parameter Make_from_compare.1-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 +E (containers.CCHeap.Make_from_compare.1-E)

Parameter Make_from_compare.1-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 index 4f836647..21834b00 100644 --- a/dev/containers/CCHeap/Make_from_compare/index.html +++ b/dev/containers/CCHeap/Make_from_compare/index.html @@ -1,5 +1,5 @@ -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 : +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 -> diff --git a/dev/containers/CCHeap/index.html b/dev/containers/CCHeap/index.html index 0324832a..5c6a7bd3 100644 --- a/dev/containers/CCHeap/index.html +++ b/dev/containers/CCHeap/index.html @@ -1,2 +1,2 @@ -CCHeap (containers.CCHeap)

Module CCHeap

Leftist Heaps

Implementation following Okasaki's book.

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type PARTIAL_ORD = sig ... end
module type TOTAL_ORD = sig ... end
module type S = sig ... end
module Make (E : PARTIAL_ORD) : S with type elt = E.t
module Make_from_compare (E : TOTAL_ORD) : S with type elt = E.t

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

\ No newline at end of file +CCHeap (containers.CCHeap)

Module CCHeap

Leftist Heaps

Implementation following Okasaki's book.

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type PARTIAL_ORD = sig ... end
module type TOTAL_ORD = sig ... end
module type S = sig ... end
module Make (E : PARTIAL_ORD) : S with type elt = E.t
module Make_from_compare (E : TOTAL_ORD) : S with type elt = E.t

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

\ 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 index e14dea4b..86fc1e0a 100644 --- a/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html +++ b/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html @@ -1,2 +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 +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 index 395ab18b..db8d7332 100644 --- a/dev/containers/CCHeap/module-type-S/index.html +++ b/dev/containers/CCHeap/module-type-S/index.html @@ -1,5 +1,5 @@ -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 : +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 -> diff --git a/dev/containers/CCHeap/module-type-TOTAL_ORD/index.html b/dev/containers/CCHeap/module-type-TOTAL_ORD/index.html index 3b9ec4e5..e8fa7409 100644 --- a/dev/containers/CCHeap/module-type-TOTAL_ORD/index.html +++ b/dev/containers/CCHeap/module-type-TOTAL_ORD/index.html @@ -1,2 +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 +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/CCIO/File/index.html b/dev/containers/CCIO/File/index.html index ab3d37f9..1e3099fd 100644 --- a/dev/containers/CCIO/File/index.html +++ b/dev/containers/CCIO/File/index.html @@ -1,5 +1,5 @@ -File (containers.CCIO.File)

Module CCIO.File

type t = string

A file should be represented by its absolute path, but currently this is not enforced.

val to_string : t -> string
val make : string -> t

Build a file representation from a path (absolute or relative).

val exists : t -> bool
val is_directory : t -> bool
val remove_exn : t -> unit

remove_exn path tries to remove the file at path from the file system.

  • raises Sys_error

    if there is no file at path or access rights are wrong.

  • since 0.8
val remove : t -> unit or_error

Like remove_exn but with an error monad.

  • since 0.8
val remove_noerr : t -> unit

Like remove_exn but do not raise any exception on failure.

  • since 0.8
val read_dir : ?recurse:bool -> t -> t gen

read_dir d returns a sequence of files and directory contained in the directory d (or an empty stream if d is not a directory).

  • raises Sys_error

    in case of error (e.g. permission denied).

  • parameter recurse

    if true (default false), sub-directories are also explored.

val read_exn : t -> string

Read the content of the given file, or raises some exception.

  • raises Sys_error

    in case of error.

  • since 0.16
val read : t -> string or_error

Read the content of the given file.

  • since 0.16
val append_exn : t -> string -> unit

Append the given string into the given file, possibly raising.

  • raises Sys_error

    in case of error.

  • since 0.16
val append : t -> string -> unit or_error

Append the given string into the given file.

  • since 0.16
val write_exn : t -> string -> unit

Write the given string into the given file, possibly raising.

  • raises Sys_error

    in case of error.

  • since 0.16
val write : t -> string -> unit or_error

Write the given string into the given file.

  • since 0.16
type walk_item = [ `File | `Dir ] * t
val walk : t -> walk_item gen

Like read_dir (with recurse=true), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy is_directory (including symlinks, etc.)

  • raises Sys_error

    in case of error (e.g. permission denied) during iteration.

val walk_iter : t -> walk_item iter

Like walk but with an imperative iterator.

  • since 3.6
val walk_l : t -> walk_item list

Like walk but returns a list (therefore it's eager and might take some time on large directories).

  • since 1.1
val walk_seq : t -> walk_item Stdlib.Seq.t

Like walk but returns a Seq

  • since 3.6
val show_walk_item : walk_item -> string
val with_temp : +File (containers.CCIO.File)

Module CCIO.File

type t = string

A file should be represented by its absolute path, but currently this is not enforced.

val to_string : t -> string
val make : string -> t

Build a file representation from a path (absolute or relative).

val exists : t -> bool
val is_directory : t -> bool
val remove_exn : t -> unit

remove_exn path tries to remove the file at path from the file system.

  • raises Sys_error

    if there is no file at path or access rights are wrong.

  • since 0.8
val remove : t -> unit or_error

Like remove_exn but with an error monad.

  • since 0.8
val remove_noerr : t -> unit

Like remove_exn but do not raise any exception on failure.

  • since 0.8
val read_dir : ?recurse:bool -> t -> t gen

read_dir d returns a sequence of files and directory contained in the directory d (or an empty stream if d is not a directory).

  • raises Sys_error

    in case of error (e.g. permission denied).

  • parameter recurse

    if true (default false), sub-directories are also explored.

val read_exn : t -> string

Read the content of the given file, or raises some exception.

  • raises Sys_error

    in case of error.

  • since 0.16
val read : t -> string or_error

Read the content of the given file.

  • since 0.16
val append_exn : t -> string -> unit

Append the given string into the given file, possibly raising.

  • raises Sys_error

    in case of error.

  • since 0.16
val append : t -> string -> unit or_error

Append the given string into the given file.

  • since 0.16
val write_exn : t -> string -> unit

Write the given string into the given file, possibly raising.

  • raises Sys_error

    in case of error.

  • since 0.16
val write : t -> string -> unit or_error

Write the given string into the given file.

  • since 0.16
type walk_item = [ `File | `Dir ] * t
val walk : t -> walk_item gen

Like read_dir (with recurse=true), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy is_directory (including symlinks, etc.)

  • raises Sys_error

    in case of error (e.g. permission denied) during iteration.

val walk_iter : t -> walk_item iter

Like walk but with an imperative iterator.

  • since 3.6
val walk_l : t -> walk_item list

Like walk but returns a list (therefore it's eager and might take some time on large directories).

  • since 1.1
val walk_seq : t -> walk_item Stdlib.Seq.t

Like walk but returns a Seq

  • since 3.6
val show_walk_item : walk_item -> string
val with_temp : ?temp_dir:string -> prefix:string -> suffix:string -> diff --git a/dev/containers/CCIO/index.html b/dev/containers/CCIO/index.html index f0604ab4..21281a50 100644 --- a/dev/containers/CCIO/index.html +++ b/dev/containers/CCIO/index.html @@ -1,5 +1,5 @@ -CCIO (containers.CCIO)

Module CCIO

IO Utils

Simple utilities to deal with basic Input/Output tasks in a resource-safe way. For advanced IO tasks, the user is advised to use something like Lwt or Async, that are far more comprehensive.

Examples:

  • obtain the list of lines of a file:
# let l = CCIO.(with_in "/tmp/some_file" read_lines_l);;
  • transfer one file into another:
# CCIO.(
+CCIO (containers.CCIO)

Module CCIO

IO Utils

Simple utilities to deal with basic Input/Output tasks in a resource-safe way. For advanced IO tasks, the user is advised to use something like Lwt or Async, that are far more comprehensive.

Examples:

  • obtain the list of lines of a file:
# let l = CCIO.(with_in "/tmp/some_file" read_lines_l);;
  • transfer one file into another:
# CCIO.(
     with_in "/tmp/input"
       (fun ic ->
          let chunks = read_chunks_gen ic in
diff --git a/dev/containers/CCInt/Infix/index.html b/dev/containers/CCInt/Infix/index.html
index e2488fc6..dfd23185 100644
--- a/dev/containers/CCInt/Infix/index.html
+++ b/dev/containers/CCInt/Infix/index.html
@@ -1,2 +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 +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/CCInt/index.html b/dev/containers/CCInt/index.html index 25ada972..53feef37 100644 --- a/dev/containers/CCInt/index.html +++ b/dev/containers/CCInt/index.html @@ -1,2 +1,2 @@ -CCInt (containers.CCInt)

Module CCInt

Basic Int functions

type t = int
val zero : t

zero is the integer 0.

  • since 3.0
val one : t

one is the integer 1.

  • since 3.0
val minus_one : t

minus_one is the integer -1.

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

add x y is x + y.

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

sub x y is x - y.

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

mul x y is x * y.

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

div x y is x / y

  • since 3.0
val succ : t -> t

succ x is x + 1.

  • since 3.0
val pred : t -> t

pred x is x - 1.

  • since 3.0
val abs : t -> t

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

  • since 3.0
val max_int : t

max_int is the maximum integer.

  • since 3.0
val min_int : t

min_int is the minimum integer.

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

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

val equal : t -> t -> bool

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

val hash : t -> int

hash x computes the hash of x.

val sign : t -> int

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

val neg : t -> t

neg x is - x. Unary negation.

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

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

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

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

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

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

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

pp ppf x prints the integer x on ppf.

val to_float : t -> float

to_float is the same as float_of_int

  • since 3.0
val to_string : t -> string

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

  • since 0.13
val of_string : string -> t option

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

  • since 0.13
val of_string_exn : string -> t

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

  • raises Failure

    in case of failure.

  • since 3.0
val of_float : float -> t

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

  • since 3.0
val pp_binary : t printer

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

  • since 0.20
val to_string_binary : t -> string

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

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

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

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

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

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

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 1.2
val popcount : t -> int

Number of bits set to 1

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

logand is the same as (land).

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

logand is the same as (lor).

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

logxor is the same as (lxor).

  • since 3.0
val lognot : t -> t

logand is the same as lnot.

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

shift_left is the same as (lsl).

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

shift_right is the same as (asr).

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

shift_right_logical is the same as (lsr).

  • since 3.0

Infix Operators

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

Alias to range.

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

Alias to range'.

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

Module CCInt

Basic Int functions

type t = int
val zero : t

zero is the integer 0.

  • since 3.0
val one : t

one is the integer 1.

  • since 3.0
val minus_one : t

minus_one is the integer -1.

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

add x y is x + y.

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

sub x y is x - y.

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

mul x y is x * y.

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

div x y is x / y

  • since 3.0
val succ : t -> t

succ x is x + 1.

  • since 3.0
val pred : t -> t

pred x is x - 1.

  • since 3.0
val abs : t -> t

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

  • since 3.0
val max_int : t

max_int is the maximum integer.

  • since 3.0
val min_int : t

min_int is the minimum integer.

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

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

val equal : t -> t -> bool

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

val hash : t -> int

hash x computes the hash of x.

val sign : t -> int

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

val neg : t -> t

neg x is - x. Unary negation.

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

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

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

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

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

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

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

pp ppf x prints the integer x on ppf.

val to_float : t -> float

to_float is the same as float_of_int

  • since 3.0
val to_string : t -> string

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

  • since 0.13
val of_string : string -> t option

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

  • since 0.13
val of_string_exn : string -> t

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

  • raises Failure

    in case of failure.

  • since 3.0
val of_float : float -> t

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

  • since 3.0
val pp_binary : t printer

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

  • since 0.20
val to_string_binary : t -> string

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

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

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

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

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

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

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 1.2
val popcount : t -> int

Number of bits set to 1

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

logand is the same as (land).

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

logand is the same as (lor).

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

logxor is the same as (lxor).

  • since 3.0
val lognot : t -> t

logand is the same as lnot.

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

shift_left is the same as (lsl).

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

shift_right is the same as (asr).

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

shift_right_logical is the same as (lsr).

  • since 3.0

Infix Operators

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

Alias to range.

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

Alias to range'.

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

Module CCInt32.Infix

val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 32.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 32.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 32.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file +Infix (containers.CCInt32.Infix)

Module CCInt32.Infix

val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 32.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 32.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 32.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file diff --git a/dev/containers/CCInt32/index.html b/dev/containers/CCInt32/index.html index 5cfde4ed..3585f587 100644 --- a/dev/containers/CCInt32/index.html +++ b/dev/containers/CCInt32/index.html @@ -1,2 +1,2 @@ -CCInt32 (containers.CCInt32)

Module CCInt32

Helpers for 32-bit integers.

This module provides operations on the type int32 of signed 32-bit integers. Unlike the built-in int type, the type int32 is guaranteed to be exactly 32-bit wide on all platforms. All arithmetic operations over int32 are taken modulo 232.

Performance notice: values of type int32 occupy more memory space than values of type int, and arithmetic operations on int32 are generally slower than those on int. Use int32 only when the application requires exact 32-bit arithmetic.

  • since 2.1
include module type of struct include Stdlib.Int32 end
val zero : int32
val one : int32
val minus_one : int32
val neg : int32 -> int32
val add : int32 -> int32 -> int32
val sub : int32 -> int32 -> int32
val mul : int32 -> int32 -> int32
val div : int32 -> int32 -> int32
val unsigned_div : int32 -> int32 -> int32
val rem : int32 -> int32 -> int32
val unsigned_rem : int32 -> int32 -> int32
val succ : int32 -> int32
val pred : int32 -> int32
val abs : int32 -> int32
val max_int : int32
val min_int : int32
val logand : int32 -> int32 -> int32
val logor : int32 -> int32 -> int32
val logxor : int32 -> int32 -> int32
val lognot : int32 -> int32
val shift_left : int32 -> int -> int32
val shift_right : int32 -> int -> int32
val shift_right_logical : int32 -> int -> int32
val of_int : int -> int32
val to_int : int32 -> int
val unsigned_to_int : int32 -> int option
val of_float : float -> int32
val to_float : int32 -> float
val to_string : int32 -> string
val bits_of_float : float -> int32
val float_of_bits : int32 -> float
type t = int32
val compare : t -> t -> int
val unsigned_compare : t -> t -> int
val equal : t -> t -> bool
val format : string -> int32 -> string
val min : t -> t -> t

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

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

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

  • since 3.0
val hash : t -> int

hash x computes the hash of x. Like Stdlib.abs(to_intx).

val sign : t -> int

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

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

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

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

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

  • since 3.0
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val range_by : step:t -> t -> t -> t iter

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 3.0
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen

Conversion

val of_string : string -> t option

of_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.

val of_string_opt : string -> t option

of_string_opt s is an alias to of_string.

val of_string_exn : string -> t

of_string_exn s converts the given string s into a 32-bit integer. Alias to Int32.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt32.max_int+1]. If the input exceeds CCInt32.max_int it is converted to the signed integer CCInt32.min_int + input - CCInt32.max_int - 1.

The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int32.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int32.

val to_string_binary : t -> string

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

  • since 3.0

Printing

val pp : t printer

pp ppf x prints the integer x on ppf.

  • since 3.0
val pp_binary : t printer

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

  • since 3.0

Infix Operators

module Infix : sig ... end
include module type of Infix
val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 32.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 32.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 32.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file +CCInt32 (containers.CCInt32)

Module CCInt32

Helpers for 32-bit integers.

This module provides operations on the type int32 of signed 32-bit integers. Unlike the built-in int type, the type int32 is guaranteed to be exactly 32-bit wide on all platforms. All arithmetic operations over int32 are taken modulo 232.

Performance notice: values of type int32 occupy more memory space than values of type int, and arithmetic operations on int32 are generally slower than those on int. Use int32 only when the application requires exact 32-bit arithmetic.

  • since 2.1
include module type of struct include Stdlib.Int32 end
val zero : int32
val one : int32
val minus_one : int32
val neg : int32 -> int32
val add : int32 -> int32 -> int32
val sub : int32 -> int32 -> int32
val mul : int32 -> int32 -> int32
val div : int32 -> int32 -> int32
val unsigned_div : int32 -> int32 -> int32
val rem : int32 -> int32 -> int32
val unsigned_rem : int32 -> int32 -> int32
val succ : int32 -> int32
val pred : int32 -> int32
val abs : int32 -> int32
val max_int : int32
val min_int : int32
val logand : int32 -> int32 -> int32
val logor : int32 -> int32 -> int32
val logxor : int32 -> int32 -> int32
val lognot : int32 -> int32
val shift_left : int32 -> int -> int32
val shift_right : int32 -> int -> int32
val shift_right_logical : int32 -> int -> int32
val of_int : int -> int32
val to_int : int32 -> int
val unsigned_to_int : int32 -> int option
val of_float : float -> int32
val to_float : int32 -> float
val to_string : int32 -> string
val bits_of_float : float -> int32
val float_of_bits : int32 -> float
type t = int32
val compare : t -> t -> int
val unsigned_compare : t -> t -> int
val equal : t -> t -> bool
val format : string -> int32 -> string
val min : t -> t -> t

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

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

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

  • since 3.0
val hash : t -> int

hash x computes the hash of x. Like Stdlib.abs(to_intx).

val sign : t -> int

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

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

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

  • since 0.11
val popcount : t -> int

Number of bits set to 1.

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

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

  • since 3.0
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val range_by : step:t -> t -> t -> t iter

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 3.0
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen

Conversion

val of_string : string -> t option

of_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.

val of_string_opt : string -> t option

of_string_opt s is an alias to of_string.

val of_string_exn : string -> t

of_string_exn s converts the given string s into a 32-bit integer. Alias to Int32.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt32.max_int+1]. If the input exceeds CCInt32.max_int it is converted to the signed integer CCInt32.min_int + input - CCInt32.max_int - 1.

The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int32.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int32.

val to_string_binary : t -> string

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

  • since 3.0

Printing

val pp : t printer

pp ppf x prints the integer x on ppf.

  • since 3.0
val pp_binary : t printer

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

  • since 3.0

Infix Operators

module Infix : sig ... end
include module type of Infix
val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 32.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 32.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 32.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file diff --git a/dev/containers/CCInt64/Infix/index.html b/dev/containers/CCInt64/Infix/index.html index 4d171959..ba36228b 100644 --- a/dev/containers/CCInt64/Infix/index.html +++ b/dev/containers/CCInt64/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCInt64.Infix)

Module CCInt64.Infix

val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 64.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 64.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 64.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file +Infix (containers.CCInt64.Infix)

Module CCInt64.Infix

val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 64.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 64.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 64.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file diff --git a/dev/containers/CCInt64/index.html b/dev/containers/CCInt64/index.html index d8a41967..3f5acff7 100644 --- a/dev/containers/CCInt64/index.html +++ b/dev/containers/CCInt64/index.html @@ -1,2 +1,2 @@ -CCInt64 (containers.CCInt64)

Module CCInt64

Helpers for 64-bit integers.

This module provides operations on the type int64 of signed 64-bit integers. Unlike the built-in int type, the type int64 is guaranteed to be exactly 64-bit wide on all platforms. All arithmetic operations over int64 are taken modulo 264.

Performance notice: values of type int64 occupy more memory space than values of type int, and arithmetic operations on int64 are generally slower than those on int. Use int64 only when the application requires exact 64-bit arithmetic.

  • since 0.13
include module type of struct include Stdlib.Int64 end
val zero : int64
val one : int64
val minus_one : int64
val neg : int64 -> int64
val add : int64 -> int64 -> int64
val sub : int64 -> int64 -> int64
val mul : int64 -> int64 -> int64
val div : int64 -> int64 -> int64
val unsigned_div : int64 -> int64 -> int64
val rem : int64 -> int64 -> int64
val unsigned_rem : int64 -> int64 -> int64
val succ : int64 -> int64
val pred : int64 -> int64
val abs : int64 -> int64
val max_int : int64
val min_int : int64
val logand : int64 -> int64 -> int64
val logor : int64 -> int64 -> int64
val logxor : int64 -> int64 -> int64
val lognot : int64 -> int64
val shift_left : int64 -> int -> int64
val shift_right : int64 -> int -> int64
val shift_right_logical : int64 -> int -> int64
val of_int : int -> int64
val to_int : int64 -> int
val unsigned_to_int : int64 -> int option
val of_float : float -> int64
val to_float : int64 -> float
val of_int32 : int32 -> int64
val to_int32 : int64 -> int32
val of_nativeint : nativeint -> int64
val to_nativeint : int64 -> nativeint
val to_string : int64 -> string
val bits_of_float : float -> int64
val float_of_bits : int64 -> float
type t = int64
val compare : t -> t -> int
val unsigned_compare : t -> t -> int
val equal : t -> t -> bool
val format : string -> int64 -> string
val min : t -> t -> t

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

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

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

  • since 3.0
val hash : t -> int

hash x computes the hash of x. Like Stdlib.abs(to_intx).

val sign : t -> int

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

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

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

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

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

  • since 3.0
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val range_by : step:t -> t -> t -> t iter

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 3.0
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen

Conversion

val of_string : string -> t option

of_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.

val of_string_opt : string -> t option

of_string_opt s is an alias to of_string.

  • since 2.1
val of_string_exn : string -> t

of_string_exn s converts the given string s into a 64-bit integer. Alias to Int64.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt64.max_int+1]. If the input exceeds CCInt64.max_int it is converted to the signed integer CCInt64.min_int + input - CCInt64.max_int - 1.

The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int64.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int64.

val to_string_binary : t -> string

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

  • since 3.0

Printing

val pp : t printer

pp ppf x prints the integer x on ppf.

  • since 3.0
val pp_binary : t printer

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

  • since 3.0

Infix Operators

Infix operators

  • since 2.1
module Infix : sig ... end
include module type of Infix
val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 64.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 64.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 64.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file +CCInt64 (containers.CCInt64)

Module CCInt64

Helpers for 64-bit integers.

This module provides operations on the type int64 of signed 64-bit integers. Unlike the built-in int type, the type int64 is guaranteed to be exactly 64-bit wide on all platforms. All arithmetic operations over int64 are taken modulo 264.

Performance notice: values of type int64 occupy more memory space than values of type int, and arithmetic operations on int64 are generally slower than those on int. Use int64 only when the application requires exact 64-bit arithmetic.

  • since 0.13
include module type of struct include Stdlib.Int64 end
val zero : int64
val one : int64
val minus_one : int64
val neg : int64 -> int64
val add : int64 -> int64 -> int64
val sub : int64 -> int64 -> int64
val mul : int64 -> int64 -> int64
val div : int64 -> int64 -> int64
val unsigned_div : int64 -> int64 -> int64
val rem : int64 -> int64 -> int64
val unsigned_rem : int64 -> int64 -> int64
val succ : int64 -> int64
val pred : int64 -> int64
val abs : int64 -> int64
val max_int : int64
val min_int : int64
val logand : int64 -> int64 -> int64
val logor : int64 -> int64 -> int64
val logxor : int64 -> int64 -> int64
val lognot : int64 -> int64
val shift_left : int64 -> int -> int64
val shift_right : int64 -> int -> int64
val shift_right_logical : int64 -> int -> int64
val of_int : int -> int64
val to_int : int64 -> int
val unsigned_to_int : int64 -> int option
val of_float : float -> int64
val to_float : int64 -> float
val of_int32 : int32 -> int64
val to_int32 : int64 -> int32
val of_nativeint : nativeint -> int64
val to_nativeint : int64 -> nativeint
val to_string : int64 -> string
val bits_of_float : float -> int64
val float_of_bits : int64 -> float
type t = int64
val compare : t -> t -> int
val unsigned_compare : t -> t -> int
val equal : t -> t -> bool
val format : string -> int64 -> string
val min : t -> t -> t

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

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

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

  • since 3.0
val hash : t -> int

hash x computes the hash of x. Like Stdlib.abs(to_intx).

val popcount : t -> int

Number of bits set to 1.

  • since NEXT_RELEASE
val sign : t -> int

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

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

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

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

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

  • since 3.0
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val range_by : step:t -> t -> t -> t iter

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 3.0
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen

Conversion

val of_string : string -> t option

of_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.

val of_string_opt : string -> t option

of_string_opt s is an alias to of_string.

  • since 2.1
val of_string_exn : string -> t

of_string_exn s converts the given string s into a 64-bit integer. Alias to Int64.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt64.max_int+1]. If the input exceeds CCInt64.max_int it is converted to the signed integer CCInt64.min_int + input - CCInt64.max_int - 1.

The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int64.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int64.

val to_string_binary : t -> string

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

  • since 3.0

Printing

val pp : t printer

pp ppf x prints the integer x on ppf.

  • since 3.0
val pp_binary : t printer

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

  • since 3.0

Infix Operators

Infix operators

  • since 2.1
module Infix : sig ... end
include module type of Infix
val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 64.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 64.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= 64.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file diff --git a/dev/containers/CCList/Assoc/index.html b/dev/containers/CCList/Assoc/index.html index 9898483f..d629f9fc 100644 --- a/dev/containers/CCList/Assoc/index.html +++ b/dev/containers/CCList/Assoc/index.html @@ -1,5 +1,5 @@ -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 : +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 -> diff --git a/dev/containers/CCList/Infix/index.html b/dev/containers/CCList/Infix/index.html index 12311d03..d7d1c86a 100644 --- a/dev/containers/CCList/Infix/index.html +++ b/dev/containers/CCList/Infix/index.html @@ -1,5 +1,5 @@ -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 =
+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
diff --git a/dev/containers/CCList/Ref/index.html b/dev/containers/CCList/Ref/index.html
index 1d26c04e..babbd068 100644
--- a/dev/containers/CCList/Ref/index.html
+++ b/dev/containers/CCList/Ref/index.html
@@ -1,2 +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 +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 index 48d5a5e4..221d9328 100644 --- a/dev/containers/CCList/Traverse/argument-1-M/index.html +++ b/dev/containers/CCList/Traverse/argument-1-M/index.html @@ -1,2 +1,2 @@ -M (containers.CCList.Traverse.1-M)

Parameter Traverse.1-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 +M (containers.CCList.Traverse.1-M)

Parameter Traverse.1-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 index 0ff2782b..b4cea588 100644 --- a/dev/containers/CCList/Traverse/index.html +++ b/dev/containers/CCList/Traverse/index.html @@ -1,2 +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 +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/index.html b/dev/containers/CCList/index.html index 726d4dc4..6cb2f5ee 100644 --- a/dev/containers/CCList/index.html +++ b/dev/containers/CCList/index.html @@ -1,5 +1,5 @@ -CCList (containers.CCList)

Module CCList

Complements to List

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

Fast internal iterator.

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

empty is [].

val is_empty : _ t -> bool

is_empty l returns true iff l = [].

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Module CCList

Complements to List

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

Fast internal iterator.

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

empty is [].

val is_empty : _ t -> bool

is_empty l returns true iff l = [].

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • since 0.14
val fold_map_i : ( 'acc -> int -> 'a -> 'acc * 'b ) -> 'acc -> 'a list -> diff --git a/dev/containers/CCList/module-type-MONAD/index.html b/dev/containers/CCList/module-type-MONAD/index.html index 8e0bb8b0..1af44d41 100644 --- a/dev/containers/CCList/module-type-MONAD/index.html +++ b/dev/containers/CCList/module-type-MONAD/index.html @@ -1,2 +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 +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 index b487af58..4d635e72 100644 --- a/dev/containers/CCListLabels/Assoc/index.html +++ b/dev/containers/CCListLabels/Assoc/index.html @@ -1,5 +1,5 @@ -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 : +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 -> diff --git a/dev/containers/CCListLabels/Infix/index.html b/dev/containers/CCListLabels/Infix/index.html index db65812e..b0829335 100644 --- a/dev/containers/CCListLabels/Infix/index.html +++ b/dev/containers/CCListLabels/Infix/index.html @@ -1,5 +1,5 @@ -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 =
+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
diff --git a/dev/containers/CCListLabels/Ref/index.html b/dev/containers/CCListLabels/Ref/index.html
index 05163d97..7a90a2ae 100644
--- a/dev/containers/CCListLabels/Ref/index.html
+++ b/dev/containers/CCListLabels/Ref/index.html
@@ -1,2 +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 +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 index 8116d303..1d017ac3 100644 --- a/dev/containers/CCListLabels/Traverse/argument-1-M/index.html +++ b/dev/containers/CCListLabels/Traverse/argument-1-M/index.html @@ -1,2 +1,2 @@ -M (containers.CCListLabels.Traverse.1-M)

Parameter Traverse.1-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 +M (containers.CCListLabels.Traverse.1-M)

Parameter Traverse.1-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 index e388c3d7..ad83b38e 100644 --- a/dev/containers/CCListLabels/Traverse/index.html +++ b/dev/containers/CCListLabels/Traverse/index.html @@ -1,2 +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 +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 df933579..1304614a 100644 --- a/dev/containers/CCListLabels/index.html +++ b/dev/containers/CCListLabels/index.html @@ -1,5 +1,5 @@ -CCListLabels (containers.CCListLabels)

Module CCListLabels

Complements to ListLabels

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
include module type of Stdlib.ListLabels
val length : 'a list -> int
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val rev : 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val iter : f:( 'a -> unit ) -> 'a list -> unit
val rev_map : f:( 'a -> 'b ) -> 'a list -> 'b list
val concat_map : f:( 'a -> 'b list ) -> 'a list -> 'b list
val fold_left_map : +CCListLabels (containers.CCListLabels)

Module CCListLabels

Complements to ListLabels

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
include module type of Stdlib.ListLabels
val length : 'a list -> int
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val rev : 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val iter : f:( 'a -> unit ) -> 'a list -> unit
val rev_map : f:( 'a -> 'b ) -> 'a list -> 'b list
val concat_map : f:( 'a -> 'b list ) -> 'a list -> 'b list
val fold_left_map : f:( 'a -> 'b -> 'a * 'c ) -> init:'a -> 'b list -> diff --git a/dev/containers/CCListLabels/module-type-MONAD/index.html b/dev/containers/CCListLabels/module-type-MONAD/index.html index bd856d85..82a5abdb 100644 --- a/dev/containers/CCListLabels/module-type-MONAD/index.html +++ b/dev/containers/CCListLabels/module-type-MONAD/index.html @@ -1,2 +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 +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/CCMap/Make/index.html b/dev/containers/CCMap/Make/index.html index 84cc3052..8aba485a 100644 --- a/dev/containers/CCMap/Make/index.html +++ b/dev/containers/CCMap/Make/index.html @@ -1,5 +1,5 @@ -Make (containers.CCMap.Make)

Module CCMap.Make

Parameters

module O : Stdlib.Map.OrderedType

Signature

include Stdlib.Map.S +Make (containers.CCMap.Make)

Module CCMap.Make

Parameters

module O : Stdlib.Map.OrderedType

Signature

include Stdlib.Map.S with type 'a t = 'a Stdlib.Map.Make(O).t with type key = O.t
type key = O.t
type 'a t = 'a Stdlib.Map.Make(O).t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : ( key -> 'a option -> 'b option -> 'c option ) -> diff --git a/dev/containers/CCMap/index.html b/dev/containers/CCMap/index.html index 1a760e5e..f5407c72 100644 --- a/dev/containers/CCMap/index.html +++ b/dev/containers/CCMap/index.html @@ -1,4 +1,4 @@ -CCMap (containers.CCMap)

Module CCMap

Extensions of Standard Map

Provide useful functions and iterators on Map.S

  • since 0.5
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type OrderedType = Stdlib.Map.OrderedType
module type S = sig ... end
module Make +CCMap (containers.CCMap)

Module CCMap

Extensions of Standard Map

Provide useful functions and iterators on Map.S

  • since 0.5
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type OrderedType = Stdlib.Map.OrderedType
module type S = sig ... end
module Make (O : Stdlib.Map.OrderedType) : S with type 'a t = 'a Stdlib.Map.Make(O).t and type key = O.t
\ No newline at end of file diff --git a/dev/containers/CCMap/module-type-S/index.html b/dev/containers/CCMap/module-type-S/index.html index 717991f2..6c84b19a 100644 --- a/dev/containers/CCMap/module-type-S/index.html +++ b/dev/containers/CCMap/module-type-S/index.html @@ -1,5 +1,5 @@ -S (containers.CCMap.S)

Module type CCMap.S

include Stdlib.Map.S
type key
type !+'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +S (containers.CCMap.S)

Module type CCMap.S

include Stdlib.Map.S
type key
type !+'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : ( key -> 'a option -> 'b option -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers/CCMonomorphic/index.html b/dev/containers/CCMonomorphic/index.html index 7abfef01..0edb15cb 100644 --- a/dev/containers/CCMonomorphic/index.html +++ b/dev/containers/CCMonomorphic/index.html @@ -1,2 +1,2 @@ -CCMonomorphic (containers.CCMonomorphic)

Module CCMonomorphic

Shadow unsafe functions and operators from Stdlib

  • since 2.0
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
  • since 2.1
val (<>.) : float -> float -> bool
  • since 2.1
val (<.) : float -> float -> bool
  • since 2.1
val (>.) : float -> float -> bool
  • since 2.1
val (<=.) : float -> float -> bool
  • since 2.1
val (>=.) : float -> float -> bool
  • since 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
  • since 2.1
\ No newline at end of file +CCMonomorphic (containers.CCMonomorphic)

Module CCMonomorphic

Shadow unsafe functions and operators from Stdlib

  • since 2.0
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
  • since 2.1
val (<>.) : float -> float -> bool
  • since 2.1
val (<.) : float -> float -> bool
  • since 2.1
val (>.) : float -> float -> bool
  • since 2.1
val (<=.) : float -> float -> bool
  • since 2.1
val (>=.) : float -> float -> bool
  • since 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
  • since 2.1
\ No newline at end of file diff --git a/dev/containers/CCNativeint/Infix/index.html b/dev/containers/CCNativeint/Infix/index.html index 0d1b50de..1463e75a 100644 --- a/dev/containers/CCNativeint/Infix/index.html +++ b/dev/containers/CCNativeint/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCNativeint.Infix)

Module CCNativeint.Infix

val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits. The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform and 64 on a 64-bit platform.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= bitsize.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= bitsize.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file +Infix (containers.CCNativeint.Infix)

Module CCNativeint.Infix

val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits. The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform and 64 on a 64-bit platform.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= bitsize.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= bitsize.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file diff --git a/dev/containers/CCNativeint/index.html b/dev/containers/CCNativeint/index.html index 01c3f7bc..0adcc89c 100644 --- a/dev/containers/CCNativeint/index.html +++ b/dev/containers/CCNativeint/index.html @@ -1,2 +1,2 @@ -CCNativeint (containers.CCNativeint)

Module CCNativeint

Helpers for processor-native integers

This module provides operations on the type nativeint of signed 32-bit integers (on 32-bit platforms) or signed 64-bit integers (on 64-bit platforms). This integer type has exactly the same width as that of a pointer type in the C compiler. All arithmetic operations over nativeint are taken modulo 232 or 264 depending on the word size of the architecture.

Performance notice: values of type nativeint occupy more memory space than values of type int, and arithmetic operations on nativeint are generally slower than those on int. Use nativeint only when the application requires the extra bit of precision over the int type.

  • since 2.1
include module type of struct include Stdlib.Nativeint end
val zero : nativeint
val one : nativeint
val minus_one : nativeint
val neg : nativeint -> nativeint
val add : nativeint -> nativeint -> nativeint
val sub : nativeint -> nativeint -> nativeint
val mul : nativeint -> nativeint -> nativeint
val div : nativeint -> nativeint -> nativeint
val unsigned_div : nativeint -> nativeint -> nativeint
val rem : nativeint -> nativeint -> nativeint
val unsigned_rem : nativeint -> nativeint -> nativeint
val succ : nativeint -> nativeint
val pred : nativeint -> nativeint
val abs : nativeint -> nativeint
val size : int
val max_int : nativeint
val min_int : nativeint
val logand : nativeint -> nativeint -> nativeint
val logor : nativeint -> nativeint -> nativeint
val logxor : nativeint -> nativeint -> nativeint
val lognot : nativeint -> nativeint
val shift_left : nativeint -> int -> nativeint
val shift_right : nativeint -> int -> nativeint
val shift_right_logical : nativeint -> int -> nativeint
val of_int : int -> nativeint
val to_int : nativeint -> int
val unsigned_to_int : nativeint -> int option
val of_float : float -> nativeint
val to_float : nativeint -> float
val of_int32 : int32 -> nativeint
val to_int32 : nativeint -> int32
val to_string : nativeint -> string
type t = nativeint
val compare : t -> t -> int
val unsigned_compare : t -> t -> int
val equal : t -> t -> bool
val format : string -> nativeint -> string
val min : t -> t -> t

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

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

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

  • since 3.0
val hash : t -> int

hash x computes the hash of x. Like Stdlib.abs(to_intx).

val sign : t -> int

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

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

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

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

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

  • since 3.0
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val range_by : step:t -> t -> t -> t iter

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 3.0
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen

Conversion

val of_string : string -> t option

of_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.

val of_string_opt : string -> t option

of_string_opt s is an alias to of_string.

val of_string_exn : string -> t

of_string_exn s converts the given string s into a native integer. Alias to Nativeint.of_string. Convert the given string to a native integer. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCNativeint.max_int+1]. If the input exceeds CCNativeint.max_int it is converted to the signed integer CCInt64.min_int + input - CCNativeint.max_int - 1.

Raise Failure "Nativeint.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type nativeint.

val to_string_binary : t -> string

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

  • since 3.0

Printing

val pp : t printer

pp ppf x prints the integer x on ppf.

  • since 3.0
val pp_binary : t printer

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

  • since 3.0

Infix Operators

module Infix : sig ... end
include module type of Infix
val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits. The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform and 64 on a 64-bit platform.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= bitsize.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= bitsize.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file +CCNativeint (containers.CCNativeint)

Module CCNativeint

Helpers for processor-native integers

This module provides operations on the type nativeint of signed 32-bit integers (on 32-bit platforms) or signed 64-bit integers (on 64-bit platforms). This integer type has exactly the same width as that of a pointer type in the C compiler. All arithmetic operations over nativeint are taken modulo 232 or 264 depending on the word size of the architecture.

Performance notice: values of type nativeint occupy more memory space than values of type int, and arithmetic operations on nativeint are generally slower than those on int. Use nativeint only when the application requires the extra bit of precision over the int type.

  • since 2.1
include module type of struct include Stdlib.Nativeint end
val zero : nativeint
val one : nativeint
val minus_one : nativeint
val neg : nativeint -> nativeint
val add : nativeint -> nativeint -> nativeint
val sub : nativeint -> nativeint -> nativeint
val mul : nativeint -> nativeint -> nativeint
val div : nativeint -> nativeint -> nativeint
val unsigned_div : nativeint -> nativeint -> nativeint
val rem : nativeint -> nativeint -> nativeint
val unsigned_rem : nativeint -> nativeint -> nativeint
val succ : nativeint -> nativeint
val pred : nativeint -> nativeint
val abs : nativeint -> nativeint
val size : int
val max_int : nativeint
val min_int : nativeint
val logand : nativeint -> nativeint -> nativeint
val logor : nativeint -> nativeint -> nativeint
val logxor : nativeint -> nativeint -> nativeint
val lognot : nativeint -> nativeint
val shift_left : nativeint -> int -> nativeint
val shift_right : nativeint -> int -> nativeint
val shift_right_logical : nativeint -> int -> nativeint
val of_int : int -> nativeint
val to_int : nativeint -> int
val unsigned_to_int : nativeint -> int option
val of_float : float -> nativeint
val to_float : nativeint -> float
val of_int32 : int32 -> nativeint
val to_int32 : nativeint -> int32
val to_string : nativeint -> string
type t = nativeint
val compare : t -> t -> int
val unsigned_compare : t -> t -> int
val equal : t -> t -> bool
val format : string -> nativeint -> string
val min : t -> t -> t

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

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

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

  • since 3.0
val hash : t -> int

hash x computes the hash of x. Like Stdlib.abs(to_intx).

val sign : t -> int

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

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

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

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

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

  • since 3.0
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
type 'a iter = ( 'a -> unit ) -> unit
val range_by : step:t -> t -> t -> t iter

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

  • raises Invalid_argument

    if step=0.

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

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

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

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

  • since 3.0
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen

Conversion

val of_string : string -> t option

of_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.

val of_string_opt : string -> t option

of_string_opt s is an alias to of_string.

val of_string_exn : string -> t

of_string_exn s converts the given string s into a native integer. Alias to Nativeint.of_string. Convert the given string to a native integer. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCNativeint.max_int+1]. If the input exceeds CCNativeint.max_int it is converted to the signed integer CCInt64.min_int + input - CCNativeint.max_int - 1.

Raise Failure "Nativeint.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type nativeint.

val to_string_binary : t -> string

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

  • since 3.0

Printing

val pp : t printer

pp ppf x prints the integer x on ppf.

  • since 3.0
val pp_binary : t printer

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

  • since 3.0

Infix Operators

module Infix : sig ... end
include module type of Infix
val (+) : t -> t -> t

x + y is the sum of x and y. Addition.

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

x - y is the difference of x and y. Subtraction.

val (~-) : t -> t

~- x is the negation of x. Unary negation.

val (*) : t -> t -> t

x * y is the product of x and y. Multiplication.

val (/) : t -> t -> t

x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).

val (mod) : t -> t -> t

x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.

val (**) : t -> t -> t

Alias to pow

  • since 3.0
val (--) : t -> t -> t iter

Alias to range.

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

Alias to range'.

  • since 3.0
val (land) : t -> t -> t

x land y is the bitwise logical and of x and y.

val (lor) : t -> t -> t

x lor y is the bitwise logical or of x and y.

val (lxor) : t -> t -> t

x lxor y is the bitwise logical exclusive or of x and y.

val lnot : t -> t

lnot x is the bitwise logical negation of x (the bits of x are inverted).

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

x lsl y shifts x to the left by y bits. The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform and 64 on a 64-bit platform.

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

x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= bitsize.

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

x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if y < 0 or y >= bitsize.

val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (<) : t -> t -> bool
\ No newline at end of file diff --git a/dev/containers/CCOpt/Infix/index.html b/dev/containers/CCOpt/Infix/index.html index 478fd2d3..70c7e2f7 100644 --- a/dev/containers/CCOpt/Infix/index.html +++ b/dev/containers/CCOpt/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCOpt.Infix)

Module CCOpt.Infix

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

o >|= f is map f o.

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

o >>= f is the monadic bind.

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

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

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

f <$> o is like map f o.

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

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

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file +Infix (containers.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 f18a340e..813e48b3 100644 --- a/dev/containers/CCOpt/index.html +++ b/dev/containers/CCOpt/index.html @@ -1,5 +1,5 @@ -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.

  • deprecated

    use get_exn_or instead

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 : +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.

  • deprecated

    use get_exn_or instead

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 -> diff --git a/dev/containers/CCOption/Infix/index.html b/dev/containers/CCOption/Infix/index.html index a41aee2b..f91f967e 100644 --- a/dev/containers/CCOption/Infix/index.html +++ b/dev/containers/CCOption/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCOption.Infix)

Module CCOption.Infix

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

o >|= f is map f o.

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

o >>= f is the monadic bind.

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

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

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

f <$> o is like map f o.

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

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

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
val let+ : 'a t -> ( 'a -> 'b ) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ( 'a -> 'b t ) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
\ No newline at end of file +Infix (containers.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 ea567616..54b082e4 100644 --- a/dev/containers/CCOption/index.html +++ b/dev/containers/CCOption/index.html @@ -1,5 +1,5 @@ -CCOption (containers.CCOption)

Module CCOption

Basic operations on the option type.

This module replaces `CCOpt`.

  • 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.

  • deprecated

    use get_exn_or instead

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 : +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.

  • deprecated

    use get_exn_or instead

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 -> diff --git a/dev/containers/CCOrd/Infix/index.html b/dev/containers/CCOrd/Infix/index.html index bc5194e0..b86156b7 100644 --- a/dev/containers/CCOrd/Infix/index.html +++ b/dev/containers/CCOrd/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCOrd.Infix)

Module CCOrd.Infix

val (<?>) : int -> ('a t * 'a * 'a) -> int

c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; otherwise it uses ord to compare the two values x and y, of type 'a.

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

Infix equivalent of map.

\ No newline at end of file +Infix (containers.CCOrd.Infix)

Module CCOrd.Infix

val (<?>) : int -> ('a t * 'a * 'a) -> int

c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; otherwise it uses ord to compare the two values x and y, of type 'a.

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

Infix equivalent of map.

\ No newline at end of file diff --git a/dev/containers/CCOrd/index.html b/dev/containers/CCOrd/index.html index cf887ef3..d76ea55e 100644 --- a/dev/containers/CCOrd/index.html +++ b/dev/containers/CCOrd/index.html @@ -1,5 +1,5 @@ -CCOrd (containers.CCOrd)

Module CCOrd

Order combinators

Comparisons

type 'a t = 'a -> 'a -> int

Comparison (total ordering) between two elements, that returns an int.

val poly : 'a t

Polymorphic "magic" comparison. Use with care, as it will fail on some types.

  • since 3.6
val compare : 'a t

Polymorphic "magic" comparison.

  • deprecated

    since 3.6 in favor of poly. The reason is that compare is easily shadowed, can shadow other comparators, and is just generally not very descriptive.

val opp : 'a t -> 'a t

Opposite order. For example, opp cmp a b < 0 iff cmp b a > 0. This can be used to sort values in the opposite order, among other things.

val equiv : int -> int -> bool

Returns true iff the two comparison results are the same.

val int : int t
val string : string t
val bool : bool t
val float : float t

Lexicographic Combination

val (<?>) : int -> ('a t * 'a * 'a) -> int

c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; otherwise it uses ord to compare the two values x and y, of type 'a.

Example:

CCInt.compare 1 3
+CCOrd (containers.CCOrd)

Module CCOrd

Order combinators

Comparisons

type 'a t = 'a -> 'a -> int

Comparison (total ordering) between two elements, that returns an int.

val poly : 'a t

Polymorphic "magic" comparison. Use with care, as it will fail on some types.

  • since 3.6
val compare : 'a t

Polymorphic "magic" comparison.

  • deprecated

    since 3.6 in favor of poly. The reason is that compare is easily shadowed, can shadow other comparators, and is just generally not very descriptive.

val opp : 'a t -> 'a t

Opposite order. For example, opp cmp a b < 0 iff cmp b a > 0. This can be used to sort values in the opposite order, among other things.

val equiv : int -> int -> bool

Returns true iff the two comparison results are the same.

val int : int t
val string : string t
val bool : bool t
val float : float t

Lexicographic Combination

val (<?>) : int -> ('a t * 'a * 'a) -> int

c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; otherwise it uses ord to compare the two values x and y, of type 'a.

Example:

CCInt.compare 1 3
 <?> (String.compare, "a", "b")
 <?> (CCBool.compare, true, false)

Same example, using only CCOrd::

CCOrd.(int 1 3
   <?> (string, "a", "b")
diff --git a/dev/containers/CCPair/index.html b/dev/containers/CCPair/index.html
index f16133d6..c4825d57 100644
--- a/dev/containers/CCPair/index.html
+++ b/dev/containers/CCPair/index.html
@@ -1,5 +1,5 @@
 
-CCPair (containers.CCPair)

Module CCPair

Tuple Functions

type ('a, 'b) t = 'a * 'b
val make : 'a -> 'b -> ( 'a, 'b ) t

Make a tuple from its components.

  • since 0.16
val map_fst : ( 'a -> 'b ) -> ('a * 'c) -> 'b * 'c

map_fst f (x, y) returns (f x, y). Renamed from map1 since 3.0.

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

map_snd f (x, y) returns (x, f y). Renamed from map2 since 3.0.

val map : ( 'a -> 'c ) -> ( 'b -> 'd ) -> ('a * 'b) -> 'c * 'd

Synonym to (***). Map on both sides of a tuple.

val map_same : ( 'a -> 'b ) -> ('a * 'a) -> 'b * 'b

Like map but specialized for pairs with elements of the same type.

val map2 : +CCPair (containers.CCPair)

Module CCPair

Tuple Functions

type ('a, 'b) t = 'a * 'b
val make : 'a -> 'b -> ( 'a, 'b ) t

Make a tuple from its components.

  • since 0.16
val map_fst : ( 'a -> 'b ) -> ('a * 'c) -> 'b * 'c

map_fst f (x, y) returns (f x, y). Renamed from map1 since 3.0.

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

map_snd f (x, y) returns (x, f y). Renamed from map2 since 3.0.

val map : ( 'a -> 'c ) -> ( 'b -> 'd ) -> ('a * 'b) -> 'c * 'd

Synonym to (***). Map on both sides of a tuple.

val map_same : ( 'a -> 'b ) -> ('a * 'a) -> 'b * 'b

Like map but specialized for pairs with elements of the same type.

val map2 : ( 'a1 -> 'b1 -> 'c1 ) -> ( 'a2 -> 'b2 -> 'c2 ) -> ('a1 * 'a2) -> diff --git a/dev/containers/CCParse/Debug_/index.html b/dev/containers/CCParse/Debug_/index.html index 4e6aaa98..22417ad7 100644 --- a/dev/containers/CCParse/Debug_/index.html +++ b/dev/containers/CCParse/Debug_/index.html @@ -1,2 +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 +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 index 36d4b78e..678a5b6a 100644 --- a/dev/containers/CCParse/Error/index.html +++ b/dev/containers/CCParse/Error/index.html @@ -1,2 +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 +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 index 04160559..68e8842c 100644 --- a/dev/containers/CCParse/Infix/index.html +++ b/dev/containers/CCParse/Infix/index.html @@ -1,2 +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 +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 index 6cee78eb..d640b4c2 100644 --- a/dev/containers/CCParse/Position/index.html +++ b/dev/containers/CCParse/Position/index.html @@ -1,2 +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 +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 index 11d468a2..741bef66 100644 --- a/dev/containers/CCParse/Slice/index.html +++ b/dev/containers/CCParse/Slice/index.html @@ -1,2 +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 +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 index c30f2485..42939e1c 100644 --- a/dev/containers/CCParse/U/index.html +++ b/dev/containers/CCParse/U/index.html @@ -1,5 +1,5 @@ -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 : +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 -> diff --git a/dev/containers/CCParse/index.html b/dev/containers/CCParse/index.html index 5f3f010b..a9d55ef1 100644 --- a/dev/containers/CCParse/index.html +++ b/dev/containers/CCParse/index.html @@ -1,5 +1,5 @@ -CCParse (containers.CCParse)

Module CCParse

Very Simple Parser Combinators

These combinators can be used to write very simple parsers, for example to extract data from a line-oriented file, or as a replacement to Scanf.

A few examples

Some more advanced example(s) can be found in the /examples directory.

Parse a tree
open CCParse;;
+CCParse (containers.CCParse)

Module CCParse

Very Simple Parser Combinators

These combinators can be used to write very simple parsers, for example to extract data from a line-oriented file, or as a replacement to Scanf.

A few examples

Some more advanced example(s) can be found in the /examples directory.

Parse a tree
open CCParse;;
 
 type tree = L of int | N of tree * tree;;
 
diff --git a/dev/containers/CCRandom/index.html b/dev/containers/CCRandom/index.html
index 9af5fa14..5cb9fac2 100644
--- a/dev/containers/CCRandom/index.html
+++ b/dev/containers/CCRandom/index.html
@@ -1,5 +1,5 @@
 
-CCRandom (containers.CCRandom)

Module CCRandom

Random Generators

include module type of struct include Stdlib.Random end
val init : int -> unit
val full_init : int array -> unit
val self_init : unit -> unit
val bits : unit -> int
val full_int : int -> int
val int32 : Stdlib.Int32.t -> Stdlib.Int32.t
val nativeint : Stdlib.Nativeint.t -> Stdlib.Nativeint.t
val int64 : Stdlib.Int64.t -> Stdlib.Int64.t
val bool : unit -> bool
module State = Stdlib__Random.State
val get_state : unit -> State.t
val set_state : State.t -> unit
type state = Stdlib.Random.State.t
type 'a t = state -> 'a

Random generator for values of type 'a.

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

return x is the generator that always returns x. Example: let random_int = return 4 (* fair dice roll *).

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

flat_map f g st is f (g st) st.

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

Monadic bind.

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

map f g st is f (g st).

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

Delay evaluation. Useful for side-effectful generators that need some code to run for every call. Example:

let gensym = let r = ref 0 in fun () -> incr r; !r ;;
+CCRandom (containers.CCRandom)

Module CCRandom

Random Generators

include module type of struct include Stdlib.Random end
val init : int -> unit
val full_init : int array -> unit
val self_init : unit -> unit
val bits : unit -> int
val full_int : int -> int
val int32 : Stdlib.Int32.t -> Stdlib.Int32.t
val nativeint : Stdlib.Nativeint.t -> Stdlib.Nativeint.t
val int64 : Stdlib.Int64.t -> Stdlib.Int64.t
val bool : unit -> bool
module State = Stdlib__Random.State
val get_state : unit -> State.t
val set_state : State.t -> unit
type state = Stdlib.Random.State.t
type 'a t = state -> 'a

Random generator for values of type 'a.

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

return x is the generator that always returns x. Example: let random_int = return 4 (* fair dice roll *).

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

flat_map f g st is f (g st) st.

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

Monadic bind.

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

map f g st is f (g st).

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

Delay evaluation. Useful for side-effectful generators that need some code to run for every call. Example:

let gensym = let r = ref 0 in fun () -> incr r; !r ;;
 
 delay (fun () ->
   let name = gensym() in
diff --git a/dev/containers/CCRef/index.html b/dev/containers/CCRef/index.html
index 5a6019ba..6efd7111 100644
--- a/dev/containers/CCRef/index.html
+++ b/dev/containers/CCRef/index.html
@@ -1,2 +1,2 @@
 
-CCRef (containers.CCRef)

Module CCRef

Helpers for references

  • since 0.9
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a ord = 'a -> 'a -> int
type 'a eq = 'a -> 'a -> bool
type 'a iter = ( 'a -> unit ) -> unit
type 'a t = 'a Stdlib.ref
val map : ( 'a -> 'b ) -> 'a t -> 'b t

Transform the value.

val create : 'a -> 'a t

Alias to ref.

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

Call the function on the content of the reference.

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

Update the reference's content with the given function.

val incr_then_get : int t -> int

incr_then_get r increments r and returns its new value, think ++r.

  • since 0.17
val get_then_incr : int t -> int

get_then_incr r increments r and returns its old value, think r++.

  • since 0.17
val swap : 'a t -> 'a t -> unit

swap t1 t2 puts !t2 in t1 and !t1 in t2.

  • since 1.4
val compare : 'a ord -> 'a t ord
val equal : 'a eq -> 'a t eq
val to_list : 'a t -> 'a list
val to_iter : 'a t -> 'a iter
  • since 3.0
val pp : 'a printer -> 'a t printer
\ No newline at end of file +CCRef (containers.CCRef)

Module CCRef

Helpers for references

  • since 0.9
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a ord = 'a -> 'a -> int
type 'a eq = 'a -> 'a -> bool
type 'a iter = ( 'a -> unit ) -> unit
type 'a t = 'a Stdlib.ref
val map : ( 'a -> 'b ) -> 'a t -> 'b t

Transform the value.

val create : 'a -> 'a t

Alias to ref.

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

Call the function on the content of the reference.

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

Update the reference's content with the given function.

val incr_then_get : int t -> int

incr_then_get r increments r and returns its new value, think ++r.

  • since 0.17
val get_then_incr : int t -> int

get_then_incr r increments r and returns its old value, think r++.

  • since 0.17
val swap : 'a t -> 'a t -> unit

swap t1 t2 puts !t2 in t1 and !t1 in t2.

  • since 1.4
val compare : 'a ord -> 'a t ord
val equal : 'a eq -> 'a t eq
val to_list : 'a t -> 'a list
val to_iter : 'a t -> 'a iter
  • since 3.0
val pp : 'a printer -> 'a t printer
\ No newline at end of file diff --git a/dev/containers/CCResult/Infix/index.html b/dev/containers/CCResult/Infix/index.html index 997b9fe4..f7694ecc 100644 --- a/dev/containers/CCResult/Infix/index.html +++ b/dev/containers/CCResult/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCResult.Infix)

Module CCResult.Infix

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

Infix version of map.

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

Infix version of map with reversed arguments.

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

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

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

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

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

Module CCResult.Infix

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

Infix version of map.

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

Infix version of map with reversed arguments.

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

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

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

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

val let+ : ( 'a, 'e ) t -> ( 'a -> 'b ) -> ( 'b, 'e ) t
  • since 2.8
val and+ : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8
val let* : ( 'a, 'e ) t -> ( 'a -> ( 'b, 'e ) t ) -> ( 'b, 'e ) t
  • since 2.8
val and* : ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'a * 'b, 'e ) t
  • since 2.8
\ No newline at end of file diff --git a/dev/containers/CCResult/Traverse/argument-1-M/index.html b/dev/containers/CCResult/Traverse/argument-1-M/index.html index 49b7bf94..433e09f4 100644 --- a/dev/containers/CCResult/Traverse/argument-1-M/index.html +++ b/dev/containers/CCResult/Traverse/argument-1-M/index.html @@ -1,2 +1,2 @@ -M (containers.CCResult.Traverse.1-M)

Parameter Traverse.1-M

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

Monadic return.

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

Monadic bind.

\ No newline at end of file +M (containers.CCResult.Traverse.1-M)

Parameter Traverse.1-M

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

Monadic return.

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

Monadic bind.

\ No newline at end of file diff --git a/dev/containers/CCResult/Traverse/index.html b/dev/containers/CCResult/Traverse/index.html index 18e88a90..c1c93ac4 100644 --- a/dev/containers/CCResult/Traverse/index.html +++ b/dev/containers/CCResult/Traverse/index.html @@ -1,2 +1,2 @@ -Traverse (containers.CCResult.Traverse)

Module CCResult.Traverse

Parameters

module M : MONAD

Signature

val sequence_m : ( 'a M.t, 'err ) t -> ( 'a, 'err ) t M.t
val fold_m : ( 'b -> 'a -> 'b M.t ) -> 'b -> ( 'a, 'err ) t -> 'b M.t
val map_m : ( 'a -> 'b M.t ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t M.t
val retry_m : int -> ( unit -> ( 'a, 'err ) t M.t ) -> ( 'a, 'err list ) t M.t
\ No newline at end of file +Traverse (containers.CCResult.Traverse)

Module CCResult.Traverse

Parameters

module M : MONAD

Signature

val sequence_m : ( 'a M.t, 'err ) t -> ( 'a, 'err ) t M.t
val fold_m : ( 'b -> 'a -> 'b M.t ) -> 'b -> ( 'a, 'err ) t -> 'b M.t
val map_m : ( 'a -> 'b M.t ) -> ( 'a, 'err ) t -> ( 'b, 'err ) t M.t
val retry_m : int -> ( unit -> ( 'a, 'err ) t M.t ) -> ( 'a, 'err list ) t M.t
\ No newline at end of file diff --git a/dev/containers/CCResult/index.html b/dev/containers/CCResult/index.html index ae291d79..e0704afa 100644 --- a/dev/containers/CCResult/index.html +++ b/dev/containers/CCResult/index.html @@ -1,5 +1,5 @@ -CCResult (containers.CCResult)

Module CCResult

Error Monad

Uses the new "result" type from OCaml 4.03.

  • since 0.16
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type nonrec (+'good, +'bad) result = ( 'good, 'bad ) Stdlib.result =
| Ok of 'good
| Error of 'bad
type (+'good, +'bad) t = ( 'good, 'bad ) result =
| Ok of 'good
| Error of 'bad
val return : 'a -> ( 'a, 'err ) t

Successfully return a value.

val fail : 'err -> ( 'a, 'err ) t

Fail with an error.

val of_exn : exn -> ( 'a, string ) t

of_exn e uses Printexc to print the exception as a string.

val of_exn_trace : exn -> ( 'a, string ) t

of_exn_trace e is similar to of_exn e, but it adds the stacktrace to the error message.

Remember to call Printexc.record_backtrace true and compile with the debug flag for this to work.

val fail_printf : +CCResult (containers.CCResult)

Module CCResult

Error Monad

Uses the new "result" type from OCaml 4.03.

  • since 0.16
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type nonrec (+'good, +'bad) result = ( 'good, 'bad ) Stdlib.result =
| Ok of 'good
| Error of 'bad
type (+'good, +'bad) t = ( 'good, 'bad ) result =
| Ok of 'good
| Error of 'bad
val return : 'a -> ( 'a, 'err ) t

Successfully return a value.

val fail : 'err -> ( 'a, 'err ) t

Fail with an error.

val of_exn : exn -> ( 'a, string ) t

of_exn e uses Printexc to print the exception as a string.

val of_exn_trace : exn -> ( 'a, string ) t

of_exn_trace e is similar to of_exn e, but it adds the stacktrace to the error message.

Remember to call Printexc.record_backtrace true and compile with the debug flag for this to work.

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

fail_printf format uses format to obtain an error message and then returns Error msg.

val fail_fprintf : ( 'a, Stdlib.Format.formatter, unit, ( 'b, string ) t ) Stdlib.format4 -> diff --git a/dev/containers/CCResult/module-type-MONAD/index.html b/dev/containers/CCResult/module-type-MONAD/index.html index b6c9e11c..6e362612 100644 --- a/dev/containers/CCResult/module-type-MONAD/index.html +++ b/dev/containers/CCResult/module-type-MONAD/index.html @@ -1,2 +1,2 @@ -MONAD (containers.CCResult.MONAD)

Module type CCResult.MONAD

Monadic Operations

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

Monadic return.

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

Monadic bind.

\ No newline at end of file +MONAD (containers.CCResult.MONAD)

Module type CCResult.MONAD

Monadic Operations

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

Monadic return.

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

Monadic bind.

\ No newline at end of file diff --git a/dev/containers/CCSeq/Infix/index.html b/dev/containers/CCSeq/Infix/index.html index 673bf9a8..1a2855d9 100644 --- a/dev/containers/CCSeq/Infix/index.html +++ b/dev/containers/CCSeq/Infix/index.html @@ -1,2 +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 +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 index 374d4eed..c1c52b62 100644 --- a/dev/containers/CCSeq/Traverse/argument-1-M/index.html +++ b/dev/containers/CCSeq/Traverse/argument-1-M/index.html @@ -1,2 +1,2 @@ -M (containers.CCSeq.Traverse.1-M)

Parameter Traverse.1-M

type 'a t
val return : 'a -> 'a t
val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
\ No newline at end of file +M (containers.CCSeq.Traverse.1-M)

Parameter Traverse.1-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 index 1161e175..2e0aa270 100644 --- a/dev/containers/CCSeq/Traverse/index.html +++ b/dev/containers/CCSeq/Traverse/index.html @@ -1,2 +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 +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 37edb9e8..41453562 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

type +'a t = unit -> 'a node
and +'a node = 'a Stdlib.Seq.node =
| Nil
| Cons of 'a * 'a t
val nil : 'a t
val empty : 'a t
val cons : 'a -> 'a t -> 'a t
val singleton : 'a -> 'a t
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 cycle : 'a t -> 'a t

Cycle through the iterator infinitely. The iterator shouldn't be empty.

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
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 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 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 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 flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t
val filter_map : ( 'a -> 'b option ) -> 'a t -> 'b t
val flatten : 'a t t -> 'a t
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 at soon as one of them ends.

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 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 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

type +'a t = unit -> 'a node
and +'a node = 'a Stdlib.Seq.node =
| Nil
| Cons of 'a * 'a t
val nil : 'a t
val empty : 'a t
val cons : 'a -> 'a t -> 'a t
val singleton : 'a -> 'a t
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 cycle : 'a t -> 'a t

Cycle through the iterator infinitely. The iterator shouldn't be empty.

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
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 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 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 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 flat_map : ( 'a -> 'b t ) -> 'a t -> 'b t
val filter_map : ( 'a -> 'b option ) -> 'a t -> 'b t
val flatten : 'a t t -> 'a t
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 at soon as one of them ends.

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 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 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 index 7ef5a853..43fbfc4f 100644 --- a/dev/containers/CCSeq/module-type-MONAD/index.html +++ b/dev/containers/CCSeq/module-type-MONAD/index.html @@ -1,2 +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 +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/CCSet/Make/index.html b/dev/containers/CCSet/Make/index.html index 502d7311..eccf0044 100644 --- a/dev/containers/CCSet/Make/index.html +++ b/dev/containers/CCSet/Make/index.html @@ -1,5 +1,5 @@ -Make (containers.CCSet.Make)

Module CCSet.Make

Parameters

module O : Stdlib.Set.OrderedType

Signature

include Stdlib.Set.S with type t = Stdlib.Set.Make(O).t with type elt = O.t
type elt = O.t
type t = Stdlib.Set.Make(O).t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : ( elt -> unit ) -> t -> unit
val map : ( elt -> elt ) -> t -> t
val fold : ( elt -> 'a -> 'a ) -> t -> 'a -> 'a
val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val filter : ( elt -> bool ) -> t -> t
val filter_map : ( elt -> elt option ) -> t -> t
val partition : ( elt -> bool ) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val of_list : elt list -> t
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_seq : t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val min_elt_opt : t -> elt option

Safe version of min_elt.

  • since 1.5
val max_elt_opt : t -> elt option

Safe version of max_elt.

  • since 1.5
val choose_opt : t -> elt option

Safe version of choose.

  • since 1.5
val find_opt : elt -> t -> elt option

Safe version of find.

  • since 1.5
val find_first : ( elt -> bool ) -> t -> elt

Find minimum element satisfying predicate.

  • since 1.5
val find_first_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_first.

  • since 1.5
val find_last : ( elt -> bool ) -> t -> elt

Find maximum element satisfying predicate.

  • since 1.5
val find_last_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_last.

  • since 1.5
val of_iter : elt iter -> t

Build a set from the given iter of elements.

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

Build a set from the given seq of elements.

  • since 3.0
val add_iter : t -> elt iter -> t
  • since 2.8
val add_seq : elt Stdlib.Seq.t -> t -> t
  • since 3.0
val to_iter : t -> elt iter

to_iter t converts the set t to a iter of the elements.

  • since 2.8
val add_list : t -> elt list -> t
  • since 0.14
val to_list : t -> elt list

to_list t converts the set t to a list of the elements.

val to_string : +Make (containers.CCSet.Make)

Module CCSet.Make

Parameters

module O : Stdlib.Set.OrderedType

Signature

include Stdlib.Set.S with type t = Stdlib.Set.Make(O).t with type elt = O.t
type elt = O.t
type t = Stdlib.Set.Make(O).t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : ( elt -> unit ) -> t -> unit
val map : ( elt -> elt ) -> t -> t
val fold : ( elt -> 'a -> 'a ) -> t -> 'a -> 'a
val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val filter : ( elt -> bool ) -> t -> t
val filter_map : ( elt -> elt option ) -> t -> t
val partition : ( elt -> bool ) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val of_list : elt list -> t
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_seq : t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val min_elt_opt : t -> elt option

Safe version of min_elt.

  • since 1.5
val max_elt_opt : t -> elt option

Safe version of max_elt.

  • since 1.5
val choose_opt : t -> elt option

Safe version of choose.

  • since 1.5
val find_opt : elt -> t -> elt option

Safe version of find.

  • since 1.5
val find_first : ( elt -> bool ) -> t -> elt

Find minimum element satisfying predicate.

  • since 1.5
val find_first_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_first.

  • since 1.5
val find_last : ( elt -> bool ) -> t -> elt

Find maximum element satisfying predicate.

  • since 1.5
val find_last_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_last.

  • since 1.5
val of_iter : elt iter -> t

Build a set from the given iter of elements.

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

Build a set from the given seq of elements.

  • since 3.0
val add_iter : t -> elt iter -> t
  • since 2.8
val add_seq : elt Stdlib.Seq.t -> t -> t
  • since 3.0
val to_iter : t -> elt iter

to_iter t converts the set t to a iter of the elements.

  • since 2.8
val add_list : t -> elt list -> t
  • since 0.14
val to_list : t -> elt list

to_list t converts the set t to a list of the elements.

val to_string : ?start:string -> ?stop:string -> ?sep:string -> diff --git a/dev/containers/CCSet/index.html b/dev/containers/CCSet/index.html index 2f186499..054b94e1 100644 --- a/dev/containers/CCSet/index.html +++ b/dev/containers/CCSet/index.html @@ -1,4 +1,4 @@ -CCSet (containers.CCSet)

Module CCSet

Wrapper around Set

  • since 0.9
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type OrderedType = Stdlib.Set.OrderedType
module type S = sig ... end
module Make +CCSet (containers.CCSet)

Module CCSet

Wrapper around Set

  • since 0.9
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type OrderedType = Stdlib.Set.OrderedType
module type S = sig ... end
module Make (O : Stdlib.Set.OrderedType) : S with type t = Stdlib.Set.Make(O).t and type elt = O.t
\ No newline at end of file diff --git a/dev/containers/CCSet/module-type-S/index.html b/dev/containers/CCSet/module-type-S/index.html index 5d9f051e..023f3ccf 100644 --- a/dev/containers/CCSet/module-type-S/index.html +++ b/dev/containers/CCSet/module-type-S/index.html @@ -1,5 +1,5 @@ -S (containers.CCSet.S)

Module type CCSet.S

include Stdlib.Set.S
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : ( elt -> unit ) -> t -> unit
val map : ( elt -> elt ) -> t -> t
val fold : ( elt -> 'a -> 'a ) -> t -> 'a -> 'a
val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val filter : ( elt -> bool ) -> t -> t
val filter_map : ( elt -> elt option ) -> t -> t
val partition : ( elt -> bool ) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val of_list : elt list -> t
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_seq : t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val min_elt_opt : t -> elt option

Safe version of min_elt.

  • since 1.5
val max_elt_opt : t -> elt option

Safe version of max_elt.

  • since 1.5
val choose_opt : t -> elt option

Safe version of choose.

  • since 1.5
val find_opt : elt -> t -> elt option

Safe version of find.

  • since 1.5
val find_first : ( elt -> bool ) -> t -> elt

Find minimum element satisfying predicate.

  • since 1.5
val find_first_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_first.

  • since 1.5
val find_last : ( elt -> bool ) -> t -> elt

Find maximum element satisfying predicate.

  • since 1.5
val find_last_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_last.

  • since 1.5
val of_iter : elt iter -> t

Build a set from the given iter of elements.

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

Build a set from the given seq of elements.

  • since 3.0
val add_iter : t -> elt iter -> t
  • since 2.8
val add_seq : elt Stdlib.Seq.t -> t -> t
  • since 3.0
val to_iter : t -> elt iter

to_iter t converts the set t to a iter of the elements.

  • since 2.8
val add_list : t -> elt list -> t
  • since 0.14
val to_list : t -> elt list

to_list t converts the set t to a list of the elements.

val to_string : +S (containers.CCSet.S)

Module type CCSet.S

include Stdlib.Set.S
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : ( elt -> unit ) -> t -> unit
val map : ( elt -> elt ) -> t -> t
val fold : ( elt -> 'a -> 'a ) -> t -> 'a -> 'a
val for_all : ( elt -> bool ) -> t -> bool
val exists : ( elt -> bool ) -> t -> bool
val filter : ( elt -> bool ) -> t -> t
val filter_map : ( elt -> elt option ) -> t -> t
val partition : ( elt -> bool ) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val of_list : elt list -> t
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_seq : t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val min_elt_opt : t -> elt option

Safe version of min_elt.

  • since 1.5
val max_elt_opt : t -> elt option

Safe version of max_elt.

  • since 1.5
val choose_opt : t -> elt option

Safe version of choose.

  • since 1.5
val find_opt : elt -> t -> elt option

Safe version of find.

  • since 1.5
val find_first : ( elt -> bool ) -> t -> elt

Find minimum element satisfying predicate.

  • since 1.5
val find_first_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_first.

  • since 1.5
val find_last : ( elt -> bool ) -> t -> elt

Find maximum element satisfying predicate.

  • since 1.5
val find_last_opt : ( elt -> bool ) -> t -> elt option

Safe version of find_last.

  • since 1.5
val of_iter : elt iter -> t

Build a set from the given iter of elements.

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

Build a set from the given seq of elements.

  • since 3.0
val add_iter : t -> elt iter -> t
  • since 2.8
val add_seq : elt Stdlib.Seq.t -> t -> t
  • since 3.0
val to_iter : t -> elt iter

to_iter t converts the set t to a iter of the elements.

  • since 2.8
val add_list : t -> elt list -> t
  • since 0.14
val to_list : t -> elt list

to_list t converts the set t to a list of the elements.

val to_string : ?start:string -> ?stop:string -> ?sep:string -> diff --git a/dev/containers/CCSexp/Decoder/index.html b/dev/containers/CCSexp/Decoder/index.html index 19d3b6be..78a0c0f0 100644 --- a/dev/containers/CCSexp/Decoder/index.html +++ b/dev/containers/CCSexp/Decoder/index.html @@ -1,2 +1,2 @@ -Decoder (containers.CCSexp.Decoder)

Module CCSexp.Decoder

type t

Decoder

val of_lexbuf : Stdlib.Lexing.lexbuf -> t
val next : t -> sexp parse_result

Parse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.

val to_list : t -> sexp list CCSexp_intf.or_error

Read all the values from this decoder.

  • since 2.8
val last_loc : t -> loc option

Last location for the decoder. In particular, after calling next, this gives the location of the last token used in the result, which is useful in case of error.

  • since 3.3
\ No newline at end of file +Decoder (containers.CCSexp.Decoder)

Module CCSexp.Decoder

type t

Decoder

val of_lexbuf : Stdlib.Lexing.lexbuf -> t
val next : t -> sexp parse_result

Parse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.

val to_list : t -> sexp list CCSexp_intf.or_error

Read all the values from this decoder.

  • since 2.8
val last_loc : t -> loc option

Last location for the decoder. In particular, after calling next, this gives the location of the last token used in the result, which is useful in case of error.

  • since 3.3
\ No newline at end of file diff --git a/dev/containers/CCSexp/Make/Decoder/index.html b/dev/containers/CCSexp/Make/Decoder/index.html index 28523306..4baa65bf 100644 --- a/dev/containers/CCSexp/Make/Decoder/index.html +++ b/dev/containers/CCSexp/Make/Decoder/index.html @@ -1,2 +1,2 @@ -Decoder (containers.CCSexp.Make.Decoder)

Module Make.Decoder

type t

Decoder

val of_lexbuf : Stdlib.Lexing.lexbuf -> t
val next : t -> sexp parse_result

Parse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.

val to_list : t -> sexp list CCSexp_intf.or_error

Read all the values from this decoder.

  • since 2.8
val last_loc : t -> loc option

Last location for the decoder. In particular, after calling next, this gives the location of the last token used in the result, which is useful in case of error.

  • since 3.3
\ No newline at end of file +Decoder (containers.CCSexp.Make.Decoder)

Module Make.Decoder

type t

Decoder

val of_lexbuf : Stdlib.Lexing.lexbuf -> t
val next : t -> sexp parse_result

Parse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.

val to_list : t -> sexp list CCSexp_intf.or_error

Read all the values from this decoder.

  • since 2.8
val last_loc : t -> loc option

Last location for the decoder. In particular, after calling next, this gives the location of the last token used in the result, which is useful in case of error.

  • since 3.3
\ No newline at end of file diff --git a/dev/containers/CCSexp/Make/argument-1-Sexp/index.html b/dev/containers/CCSexp/Make/argument-1-Sexp/index.html index 0118101b..79b01c27 100644 --- a/dev/containers/CCSexp/Make/argument-1-Sexp/index.html +++ b/dev/containers/CCSexp/Make/argument-1-Sexp/index.html @@ -1,2 +1,2 @@ -Sexp (containers.CCSexp.Make.1-Sexp)

Parameter Make.1-Sexp

include CCSexp_intf.BASIC_SEXP
type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
type loc
val make_loc : ( (int * int) -> (int * int) -> string -> loc ) option

If provided, builds a location from a pair of (line,column) positions, and a (possibly dummy) filename

val atom_with_loc : loc:loc -> string -> t
val list_with_loc : loc:loc -> t list -> t
\ No newline at end of file +Sexp (containers.CCSexp.Make.1-Sexp)

Parameter Make.1-Sexp

include CCSexp_intf.BASIC_SEXP
type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
type loc
val make_loc : ( (int * int) -> (int * int) -> string -> loc ) option

If provided, builds a location from a pair of (line,column) positions, and a (possibly dummy) filename

val atom_with_loc : loc:loc -> string -> t
val list_with_loc : loc:loc -> t list -> t
\ No newline at end of file diff --git a/dev/containers/CCSexp/Make/index.html b/dev/containers/CCSexp/Make/index.html index fb7cc0bb..c6d25fa6 100644 --- a/dev/containers/CCSexp/Make/index.html +++ b/dev/containers/CCSexp/Make/index.html @@ -1,4 +1,4 @@ -Make (containers.CCSexp.Make)

Module CCSexp.Make

Functorized operations

This builds a parser and printer for S-expressions represented as in the Sexp argument.

  • since 2.7
  • since 3.4 re-bind [loc] to [Sexp.loc]

Parameters

module Sexp : SEXP

Signature

include CCSexp_intf.S0 with type t = Sexp.t
type t = Sexp.t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : +Make (containers.CCSexp.Make)

Module CCSexp.Make

Functorized operations

This builds a parser and printer for S-expressions represented as in the Sexp argument.

  • since 2.7
  • since 3.4 re-bind [loc] to [Sexp.loc]

Parameters

module Sexp : SEXP

Signature

include CCSexp_intf.S0 with type t = Sexp.t
type t = Sexp.t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_error
val parse_file : string -> t CCSexp_intf.or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list CCSexp_intf.or_error

Open the file and read a S-exp from it.

type loc = Sexp.loc

Locations for the S-expressions.

  • since 3.3

Parsing

type 'a parse_result =
| Yield of 'a
| Fail of string
| End

A parser of 'a can return Yield x when it parsed a value, or Fail e when a parse error was encountered, or End if the input was empty.

module Decoder : sig ... end
\ No newline at end of file diff --git a/dev/containers/CCSexp/index.html b/dev/containers/CCSexp/index.html index 16bdba3a..36d47b31 100644 --- a/dev/containers/CCSexp/index.html +++ b/dev/containers/CCSexp/index.html @@ -1,4 +1,4 @@ -CCSexp (containers.CCSexp)

Module CCSexp

Handling S-expressions

  • since 3.0 moved into containers-core, previously in [containers.sexp]
type 'a or_error = ( 'a, string ) Stdlib.result
type 'a gen = unit -> 'a option
module type SEXP = CCSexp_intf.SEXP
module type S = CCSexp_intf.S
module Make (Sexp : SEXP) : S with type t = Sexp.t and type loc = Sexp.loc

Basics

type t = [
| `Atom of string
| `List of t list
]

A simple, structural representation of S-expressions.

include S with type t := t
include CCSexp_intf.S0 with type t := t
type sexp = t

Re-exports

val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : +CCSexp (containers.CCSexp)

Module CCSexp

Handling S-expressions

  • since 3.0 moved into containers-core, previously in [containers.sexp]
type 'a or_error = ( 'a, string ) Stdlib.result
type 'a gen = unit -> 'a option
module type SEXP = CCSexp_intf.SEXP
module type S = CCSexp_intf.S
module Make (Sexp : SEXP) : S with type t = Sexp.t and type loc = Sexp.loc

Basics

type t = [
| `Atom of string
| `List of t list
]

A simple, structural representation of S-expressions.

include S with type t := t
include CCSexp_intf.S0 with type t := t
type sexp = t

Re-exports

val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t CCSexp_intf.iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t CCSexp_intf.or_error

Parse a string.

val parse_string_list : string -> t list CCSexp_intf.or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_error
val parse_file : string -> t CCSexp_intf.or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list CCSexp_intf.or_error

Open the file and read a S-exp from it.

type loc

Locations for the S-expressions.

  • since 3.3

Parsing

type 'a parse_result =
| Yield of 'a
| Fail of string
| End

A parser of 'a can return Yield x when it parsed a value, or Fail e when a parse error was encountered, or End if the input was empty.

module Decoder : sig ... end
val equal : t -> t -> bool
  • since 3.0
val compare : t -> t -> int
  • since 3.0
val atom : string -> t

Build an atom directly from a string.

\ No newline at end of file diff --git a/dev/containers/CCSexp_intf/index.html b/dev/containers/CCSexp_intf/index.html index 19bf898d..9fb547af 100644 --- a/dev/containers/CCSexp_intf/index.html +++ b/dev/containers/CCSexp_intf/index.html @@ -1,2 +1,2 @@ -CCSexp_intf (containers.CCSexp_intf)

Module CCSexp_intf

type 'a or_error = ( 'a, string ) Stdlib.result
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
module type BASIC_SEXP = sig ... end
module type SEXP = sig ... end
module type S0 = sig ... end
module type S = sig ... end
\ No newline at end of file +CCSexp_intf (containers.CCSexp_intf)

Module CCSexp_intf

type 'a or_error = ( 'a, string ) Stdlib.result
type 'a iter = ( 'a -> unit ) -> unit
type 'a gen = unit -> 'a option
module type BASIC_SEXP = sig ... end
module type SEXP = sig ... end
module type S0 = sig ... end
module type S = sig ... end
\ No newline at end of file diff --git a/dev/containers/CCSexp_intf/module-type-BASIC_SEXP/index.html b/dev/containers/CCSexp_intf/module-type-BASIC_SEXP/index.html index 9397eded..258a805f 100644 --- a/dev/containers/CCSexp_intf/module-type-BASIC_SEXP/index.html +++ b/dev/containers/CCSexp_intf/module-type-BASIC_SEXP/index.html @@ -1,2 +1,2 @@ -BASIC_SEXP (containers.CCSexp_intf.BASIC_SEXP)

Module type CCSexp_intf.BASIC_SEXP

Abstract representation of S-expressions

  • since 3.3
type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
\ No newline at end of file +BASIC_SEXP (containers.CCSexp_intf.BASIC_SEXP)

Module type CCSexp_intf.BASIC_SEXP

Abstract representation of S-expressions

  • since 3.3
type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
\ No newline at end of file diff --git a/dev/containers/CCSexp_intf/module-type-S/Decoder/index.html b/dev/containers/CCSexp_intf/module-type-S/Decoder/index.html index bd95738a..ad280bc6 100644 --- a/dev/containers/CCSexp_intf/module-type-S/Decoder/index.html +++ b/dev/containers/CCSexp_intf/module-type-S/Decoder/index.html @@ -1,2 +1,2 @@ -Decoder (containers.CCSexp_intf.S.Decoder)

Module S.Decoder

type t

Decoder

val of_lexbuf : Stdlib.Lexing.lexbuf -> t
val next : t -> sexp parse_result

Parse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.

val to_list : t -> sexp list or_error

Read all the values from this decoder.

  • since 2.8
val last_loc : t -> loc option

Last location for the decoder. In particular, after calling next, this gives the location of the last token used in the result, which is useful in case of error.

  • since 3.3
\ No newline at end of file +Decoder (containers.CCSexp_intf.S.Decoder)

Module S.Decoder

type t

Decoder

val of_lexbuf : Stdlib.Lexing.lexbuf -> t
val next : t -> sexp parse_result

Parse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.

val to_list : t -> sexp list or_error

Read all the values from this decoder.

  • since 2.8
val last_loc : t -> loc option

Last location for the decoder. In particular, after calling next, this gives the location of the last token used in the result, which is useful in case of error.

  • since 3.3
\ No newline at end of file diff --git a/dev/containers/CCSexp_intf/module-type-S/index.html b/dev/containers/CCSexp_intf/module-type-S/index.html index e311c1d3..1586ffe6 100644 --- a/dev/containers/CCSexp_intf/module-type-S/index.html +++ b/dev/containers/CCSexp_intf/module-type-S/index.html @@ -1,2 +1,2 @@ -S (containers.CCSexp_intf.S)

Module type CCSexp_intf.S

Operations over S-expressions (extended)

  • since 2.7
include S0
type t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t or_error

Parse a string.

val parse_string_list : string -> t list or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t or_error gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list or_error
val parse_file : string -> t or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list or_error

Open the file and read a S-exp from it.

type loc

Locations for the S-expressions.

  • since 3.3

Parsing

type 'a parse_result =
| Yield of 'a
| Fail of string
| End

A parser of 'a can return Yield x when it parsed a value, or Fail e when a parse error was encountered, or End if the input was empty.

module Decoder : sig ... end
\ No newline at end of file +S (containers.CCSexp_intf.S)

Module type CCSexp_intf.S

Operations over S-expressions (extended)

  • since 2.7
include S0
type t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t or_error

Parse a string.

val parse_string_list : string -> t list or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t or_error gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list or_error
val parse_file : string -> t or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list or_error

Open the file and read a S-exp from it.

type loc

Locations for the S-expressions.

  • since 3.3

Parsing

type 'a parse_result =
| Yield of 'a
| Fail of string
| End

A parser of 'a can return Yield x when it parsed a value, or Fail e when a parse error was encountered, or End if the input was empty.

module Decoder : sig ... end
\ No newline at end of file diff --git a/dev/containers/CCSexp_intf/module-type-S0/index.html b/dev/containers/CCSexp_intf/module-type-S0/index.html index 66486313..a27c8047 100644 --- a/dev/containers/CCSexp_intf/module-type-S0/index.html +++ b/dev/containers/CCSexp_intf/module-type-S0/index.html @@ -1,2 +1,2 @@ -S0 (containers.CCSexp_intf.S0)

Module type CCSexp_intf.S0

Operations over S-expressions

  • since 2.7
type t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t or_error

Parse a string.

val parse_string_list : string -> t list or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t or_error gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list or_error
val parse_file : string -> t or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list or_error

Open the file and read a S-exp from it.

\ No newline at end of file +S0 (containers.CCSexp_intf.S0)

Module type CCSexp_intf.S0

Operations over S-expressions

  • since 2.7
type t
type sexp = t

Re-exports

val atom : string -> t

Make an atom out of this string.

  • since 2.8
val list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

val of_int : int -> t
val of_bool : bool -> t
val of_list : t list -> t
val of_rev_list : t list -> t

Reverse the list.

val of_float : float -> t
val of_unit : t
val of_pair : (t * t) -> t
val of_triple : (t * t * t) -> t
val of_quad : (t * t * t * t) -> t
val of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

val of_field : string -> t -> t

Used to represent one record field.

val of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

val to_buf : Stdlib.Buffer.t -> t -> unit
val to_string : t -> string
val to_file : string -> t -> unit
val to_file_iter : string -> t iter -> unit

Print the given iter of expressions to a file.

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

Pretty-printer nice on human eyes (including indentation).

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

Raw, direct printing as compact as possible.

Parsing

val parse_string : string -> t or_error

Parse a string.

val parse_string_list : string -> t list or_error

Parse a string into a list of S-exprs.

  • since 2.8
val parse_chan : Stdlib.in_channel -> t or_error

Parse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).

val parse_chan_gen : Stdlib.in_channel -> t or_error gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Stdlib.in_channel -> t list or_error
val parse_file : string -> t or_error

Open the file and read a S-exp from it.

val parse_file_list : string -> t list or_error

Open the file and read a S-exp from it.

\ No newline at end of file diff --git a/dev/containers/CCSexp_intf/module-type-SEXP/index.html b/dev/containers/CCSexp_intf/module-type-SEXP/index.html index fa5a1e21..856860f4 100644 --- a/dev/containers/CCSexp_intf/module-type-SEXP/index.html +++ b/dev/containers/CCSexp_intf/module-type-SEXP/index.html @@ -1,2 +1,2 @@ -SEXP (containers.CCSexp_intf.SEXP)

Module type CCSexp_intf.SEXP

Abstract representation of S-expressions (extended)

  • since 2.7
include BASIC_SEXP
type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
type loc
val make_loc : ( (int * int) -> (int * int) -> string -> loc ) option

If provided, builds a location from a pair of (line,column) positions, and a (possibly dummy) filename

val atom_with_loc : loc:loc -> string -> t
val list_with_loc : loc:loc -> t list -> t
\ No newline at end of file +SEXP (containers.CCSexp_intf.SEXP)

Module type CCSexp_intf.SEXP

Abstract representation of S-expressions (extended)

  • since 2.7
include BASIC_SEXP
type t
val atom : string -> t
val list : t list -> t
val match_ : t -> atom:( string -> 'a ) -> list:( t list -> 'a ) -> 'a
type loc
val make_loc : ( (int * int) -> (int * int) -> string -> loc ) option

If provided, builds a location from a pair of (line,column) positions, and a (possibly dummy) filename

val atom_with_loc : loc:loc -> string -> t
val list_with_loc : loc:loc -> t list -> t
\ No newline at end of file diff --git a/dev/containers/CCSexp_lex/index.html b/dev/containers/CCSexp_lex/index.html index e2c2bd40..109bdf08 100644 --- a/dev/containers/CCSexp_lex/index.html +++ b/dev/containers/CCSexp_lex/index.html @@ -1,2 +1,2 @@ -CCSexp_lex (containers.CCSexp_lex)

Module CCSexp_lex

type token =
| ATOM of string
| LIST_OPEN
| LIST_CLOSE
| SEXP_COMMENT
| EOI
exception Error of int * int * string
val error : Stdlib.Lexing.lexbuf -> string -> 'a
type unescape_state =
| Not_escaped
| Escaped
| Escaped_int_1 of int
| Escaped_int_2 of int
val char_equal : char -> char -> bool
val remove_quotes : Stdlib.Lexing.lexbuf -> string -> string
val __ocaml_lex_tables : Stdlib.Lexing.lex_tables
val token : Stdlib.Lexing.lexbuf -> token
val __ocaml_lex_token_rec : Stdlib.Lexing.lexbuf -> int -> token
\ No newline at end of file +CCSexp_lex (containers.CCSexp_lex)

Module CCSexp_lex

type token =
| ATOM of string
| LIST_OPEN
| LIST_CLOSE
| SEXP_COMMENT
| EOI
exception Error of int * int * string
val error : Stdlib.Lexing.lexbuf -> string -> 'a
type unescape_state =
| Not_escaped
| Escaped
| Escaped_int_1 of int
| Escaped_int_2 of int
val char_equal : char -> char -> bool
val remove_quotes : Stdlib.Lexing.lexbuf -> string -> string
val __ocaml_lex_tables : Stdlib.Lexing.lex_tables
val token : Stdlib.Lexing.lexbuf -> token
val __ocaml_lex_token_rec : Stdlib.Lexing.lexbuf -> int -> token
\ No newline at end of file diff --git a/dev/containers/CCShims_/index.html b/dev/containers/CCShims_/index.html index 9b620588..647518a5 100644 --- a/dev/containers/CCShims_/index.html +++ b/dev/containers/CCShims_/index.html @@ -1,2 +1,2 @@ -CCShims_ (containers.CCShims_)

Module CCShims_

module Stdlib = Stdlib
\ No newline at end of file +CCShims_ (containers.CCShims_)

Module CCShims_

module Stdlib = Stdlib
\ No newline at end of file diff --git a/dev/containers/CCShims_syntax/index.html b/dev/containers/CCShims_syntax/index.html index 7f3fbb8a..b61ca0bf 100644 --- a/dev/containers/CCShims_syntax/index.html +++ b/dev/containers/CCShims_syntax/index.html @@ -1,2 +1,2 @@ -CCShims_syntax (containers.CCShims_syntax)

Module CCShims_syntax

module type LET = sig ... end

Let operators on OCaml >= 4.08.0, nothing otherwise

\ No newline at end of file +CCShims_syntax (containers.CCShims_syntax)

Module CCShims_syntax

module type LET = sig ... end

Let operators on OCaml >= 4.08.0, nothing otherwise

\ No newline at end of file diff --git a/dev/containers/CCShims_syntax/module-type-LET/index.html b/dev/containers/CCShims_syntax/module-type-LET/index.html index eb4bbf68..9e9a43c4 100644 --- a/dev/containers/CCShims_syntax/module-type-LET/index.html +++ b/dev/containers/CCShims_syntax/module-type-LET/index.html @@ -1,2 +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 +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 index 40788d7e..0495186f 100644 --- a/dev/containers/CCString/Find/index.html +++ b/dev/containers/CCString/Find/index.html @@ -1,2 +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 +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 index 8a453284..37ac3cfe 100644 --- a/dev/containers/CCString/Infix/index.html +++ b/dev/containers/CCString/Infix/index.html @@ -1,2 +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 +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 index 0bfe94f0..f56dc8bb 100644 --- a/dev/containers/CCString/Split/index.html +++ b/dev/containers/CCString/Split/index.html @@ -1,5 +1,5 @@ -Split (containers.CCString.Split)

Module CCString.Split

type drop_if_empty = {
first : bool;
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_ : +Split (containers.CCString.Split)

Module CCString.Split

type drop_if_empty = {
first : bool;
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 -> diff --git a/dev/containers/CCString/index.html b/dev/containers/CCString/index.html index a7dcfe6c..dc1af23a 100644 --- a/dev/containers/CCString/index.html +++ b/dev/containers/CCString/index.html @@ -1,5 +1,5 @@ -CCString (containers.CCString)

Module CCString

Basic String Utils

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.String end
type t = string
val make : int -> char -> string
val init : int -> ( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : string -> string list -> string
val cat : string -> string -> string
val equal : t -> t -> bool
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> int -> int -> string
val map : ( char -> char ) -> string -> string
val mapi : ( int -> char -> char ) -> string -> string
val fold_left : ( 'a -> char -> 'a ) -> 'a -> string -> 'a
val fold_right : ( char -> 'a -> 'a ) -> string -> 'a -> 'a
val trim : string -> string
val escaped : string -> string
val uppercase_ascii : string -> string
val lowercase_ascii : string -> string
val capitalize_ascii : string -> string
val uncapitalize_ascii : string -> string
val iteri : ( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val create : int -> bytes
val copy : string -> string
val fill : bytes -> int -> int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : string -> int -> bytes -> int -> int -> unit
val unsafe_fill : bytes -> int -> int -> char -> unit
val length : t -> int

length s returns the length (number of characters) of the given string s.

val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unit

blit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.

  • raises Invalid_argument

    if indices are not valid.

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

fold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].

  • since 0.7
val foldi : ( 'a -> int -> char -> 'a ) -> 'a -> t -> 'a

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

  • since 3.3

Conversions

val to_gen : t -> char gen

to_gen s returns the gen of characters contained in the string s.

val to_iter : t -> char iter

to_iter s returns the iter of characters contained in the string s.

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

to_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.

  • since 3.0
val to_list : t -> char list

to_list s returns the list of characters contained in the string s.

val pp_buf : Stdlib.Buffer.t -> t -> unit

pp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.

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

pp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.

val compare : string -> string -> int

compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.

val is_empty : string -> bool

is_empty s returns true iff s is empty (i.e. its length is 0).

  • since 1.5
val hash : string -> int

hash s returns the hash value of s.

val rev : string -> string

rev s returns the reverse of s.

  • since 0.17
val pad : ?side:[ `Left | `Right ] -> ?c:char -> int -> string -> string

pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.

  • parameter side

    determines where padding occurs (default: `Left).

  • parameter c

    the char used to pad (default: ' ').

  • since 0.17
val of_char : char -> string

of_char 'a' is "a".

  • since 0.19
val of_gen : char gen -> string

of_gen gen converts a gen of characters to a string.

val of_iter : char iter -> string

of_iter iter converts an iter of characters to a string.

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

of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.

  • since 3.0
val of_list : char list -> string

of_list lc converts a list of characters lc to a string.

val of_array : char array -> string

of_array ac converts an array of characters ac to a string.

val to_array : string -> char array

to_array s returns the array of characters contained in the string s.

val find : ?start:int -> sub:string -> string -> int

find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.

  • parameter start

    starting position in s.

val find_all : ?start:int -> sub:string -> string -> int gen

find_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.

  • parameter start

    starting position in s.

  • since 0.17
val find_all_l : ?start:int -> sub:string -> string -> int list

find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.

  • parameter start

    starting position in s.

  • since 0.17
val mem : ?start:int -> sub:string -> string -> bool

mem ~start ~sub s is true iff sub is a substring of s.

  • since 0.12
val rfind : sub:string -> string -> int

rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.

  • since 0.12
val replace : +CCString (containers.CCString)

Module CCString

Basic String Utils

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.String end
type t = string
val make : int -> char -> string
val init : int -> ( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : string -> string list -> string
val cat : string -> string -> string
val equal : t -> t -> bool
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> int -> int -> string
val map : ( char -> char ) -> string -> string
val mapi : ( int -> char -> char ) -> string -> string
val fold_left : ( 'a -> char -> 'a ) -> 'a -> string -> 'a
val fold_right : ( char -> 'a -> 'a ) -> string -> 'a -> 'a
val trim : string -> string
val escaped : string -> string
val uppercase_ascii : string -> string
val lowercase_ascii : string -> string
val capitalize_ascii : string -> string
val uncapitalize_ascii : string -> string
val iteri : ( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val create : int -> bytes
val copy : string -> string
val fill : bytes -> int -> int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : string -> int -> bytes -> int -> int -> unit
val unsafe_fill : bytes -> int -> int -> char -> unit
val length : t -> int

length s returns the length (number of characters) of the given string s.

val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unit

blit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.

  • raises Invalid_argument

    if indices are not valid.

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

fold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].

  • since 0.7
val foldi : ( 'a -> int -> char -> 'a ) -> 'a -> t -> 'a

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

  • since 3.3

Conversions

val to_gen : t -> char gen

to_gen s returns the gen of characters contained in the string s.

val to_iter : t -> char iter

to_iter s returns the iter of characters contained in the string s.

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

to_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.

  • since 3.0
val to_list : t -> char list

to_list s returns the list of characters contained in the string s.

val pp_buf : Stdlib.Buffer.t -> t -> unit

pp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.

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

pp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.

val compare : string -> string -> int

compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.

val is_empty : string -> bool

is_empty s returns true iff s is empty (i.e. its length is 0).

  • since 1.5
val hash : string -> int

hash s returns the hash value of s.

val rev : string -> string

rev s returns the reverse of s.

  • since 0.17
val pad : ?side:[ `Left | `Right ] -> ?c:char -> int -> string -> string

pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.

  • parameter side

    determines where padding occurs (default: `Left).

  • parameter c

    the char used to pad (default: ' ').

  • since 0.17
val of_char : char -> string

of_char 'a' is "a".

  • since 0.19
val of_gen : char gen -> string

of_gen gen converts a gen of characters to a string.

val of_iter : char iter -> string

of_iter iter converts an iter of characters to a string.

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

of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.

  • since 3.0
val of_list : char list -> string

of_list lc converts a list of characters lc to a string.

val of_array : char array -> string

of_array ac converts an array of characters ac to a string.

val to_array : string -> char array

to_array s returns the array of characters contained in the string s.

val find : ?start:int -> sub:string -> string -> int

find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.

  • parameter start

    starting position in s.

val find_all : ?start:int -> sub:string -> string -> int gen

find_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.

  • parameter start

    starting position in s.

  • since 0.17
val find_all_l : ?start:int -> sub:string -> string -> int list

find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.

  • parameter start

    starting position in s.

  • since 0.17
val mem : ?start:int -> sub:string -> string -> bool

mem ~start ~sub s is true iff sub is a substring of s.

  • since 0.12
val rfind : sub:string -> string -> int

rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.

  • since 0.12
val replace : ?which:[ `Left | `Right | `All ] -> sub:string -> by:string -> diff --git a/dev/containers/CCStringLabels/Find/index.html b/dev/containers/CCStringLabels/Find/index.html index c5bf6ae2..c557c26b 100644 --- a/dev/containers/CCStringLabels/Find/index.html +++ b/dev/containers/CCStringLabels/Find/index.html @@ -1,2 +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 +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 index d474ce4b..d8067fdc 100644 --- a/dev/containers/CCStringLabels/Infix/index.html +++ b/dev/containers/CCStringLabels/Infix/index.html @@ -1,2 +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 +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 index 485ea04c..bd231816 100644 --- a/dev/containers/CCStringLabels/Split/index.html +++ b/dev/containers/CCStringLabels/Split/index.html @@ -1,5 +1,5 @@ -Split (containers.CCStringLabels.Split)

Module CCStringLabels.Split

type drop_if_empty = {
first : bool;
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_ : +Split (containers.CCStringLabels.Split)

Module CCStringLabels.Split

type drop_if_empty = {
first : bool;
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 -> diff --git a/dev/containers/CCStringLabels/index.html b/dev/containers/CCStringLabels/index.html index 05d10ed8..7c02015f 100644 --- a/dev/containers/CCStringLabels/index.html +++ b/dev/containers/CCStringLabels/index.html @@ -1,5 +1,5 @@ -CCStringLabels (containers.CCStringLabels)

Module CCStringLabels

Basic String Utils (Labeled version of CCString)

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.StringLabels end
type t = string
val make : int -> char -> string
val init : int -> f:( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : sep:string -> string list -> string
val cat : string -> string -> string
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> pos:int -> len:int -> string
val map : f:( char -> char ) -> string -> string
val mapi : f:( int -> char -> char ) -> string -> string
val fold_left : f:( 'a -> char -> 'a ) -> init:'a -> string -> 'a
val fold_right : f:( char -> 'a -> 'a ) -> string -> init:'a -> 'a
val trim : string -> string
val escaped : string -> string
val iteri : f:( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val create : int -> bytes
val copy : string -> string
val fill : bytes -> pos:int -> len:int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : +CCStringLabels (containers.CCStringLabels)

Module CCStringLabels

Basic String Utils (Labeled version of CCString)

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.StringLabels end
type t = string
val make : int -> char -> string
val init : int -> f:( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : sep:string -> string list -> string
val cat : string -> string -> string
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> pos:int -> len:int -> string
val map : f:( char -> char ) -> string -> string
val mapi : f:( int -> char -> char ) -> string -> string
val fold_left : f:( 'a -> char -> 'a ) -> init:'a -> string -> 'a
val fold_right : f:( char -> 'a -> 'a ) -> string -> init:'a -> 'a
val trim : string -> string
val escaped : string -> string
val iteri : f:( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val create : int -> bytes
val copy : string -> string
val fill : bytes -> pos:int -> len:int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : src:string -> src_pos:int -> dst:bytes -> diff --git a/dev/containers/CCUnit/index.html b/dev/containers/CCUnit/index.html index 06d5aab8..94a1ecd7 100644 --- a/dev/containers/CCUnit/index.html +++ b/dev/containers/CCUnit/index.html @@ -1,2 +1,2 @@ -CCUnit (containers.CCUnit)

Module CCUnit

include module type of struct include Stdlib.Unit end
type t = unit =
| ()
val equal : t -> t -> bool
val compare : t -> t -> int
val to_string : t -> string
\ No newline at end of file +CCUnit (containers.CCUnit)

Module CCUnit

include module type of struct include Stdlib.Unit end
type t = unit =
| ()
val equal : t -> t -> bool
val compare : t -> t -> int
val to_string : t -> string
\ No newline at end of file diff --git a/dev/containers/CCUnix/Infix/index.html b/dev/containers/CCUnix/Infix/index.html index a0ad456c..a9824809 100644 --- a/dev/containers/CCUnix/Infix/index.html +++ b/dev/containers/CCUnix/Infix/index.html @@ -1,4 +1,4 @@ -Infix (containers.CCUnix.Infix)

Module CCUnix.Infix

val (?|) : ( 'a, Stdlib.Buffer.t, unit, call_result ) Stdlib.format4 -> 'a

Infix version of call.

  • since 0.11
val (?|&) : +Infix (containers.CCUnix.Infix)

Module CCUnix.Infix

val (?|) : ( 'a, Stdlib.Buffer.t, unit, call_result ) Stdlib.format4 -> 'a

Infix version of call.

  • since 0.11
val (?|&) : ( 'a, Stdlib.Buffer.t, unit, async_call_result ) Stdlib.format4 -> 'a

Infix version of async_call.

  • since 0.11
\ No newline at end of file diff --git a/dev/containers/CCUnix/index.html b/dev/containers/CCUnix/index.html index c9d0dd9d..1ad4aaa4 100644 --- a/dev/containers/CCUnix/index.html +++ b/dev/containers/CCUnix/index.html @@ -1,5 +1,5 @@ -CCUnix (containers.CCUnix)

Module CCUnix

High-level Functions on top of Unix

Some useful functions built on top of Unix.

status: unstable

  • since 0.10
type 'a or_error = ( 'a, string ) Stdlib.result
type 'a gen = unit -> 'a option

Calling Commands

val escape_str : string -> string

Escape a string so it can be a shell argument.

type call_result = +CCUnix (containers.CCUnix)

Module CCUnix

High-level Functions on top of Unix

Some useful functions built on top of Unix.

status: unstable

  • since 0.10
type 'a or_error = ( 'a, string ) Stdlib.result
type 'a gen = unit -> 'a option

Calling Commands

val escape_str : string -> string

Escape a string so it can be a shell argument.

type call_result = < stdout : string ; stderr : string ; status : Unix.process_status diff --git a/dev/containers/CCUtf8_string/index.html b/dev/containers/CCUtf8_string/index.html index b596a760..e0a76305 100644 --- a/dev/containers/CCUtf8_string/index.html +++ b/dev/containers/CCUtf8_string/index.html @@ -1,2 +1,2 @@ -CCUtf8_string (containers.CCUtf8_string)

Module CCUtf8_string

Unicode String, in UTF8

A unicode string represented by a utf8 bytestring. This representation is convenient for manipulating normal OCaml strings that are encoded in UTF8.

We perform only basic decoding and encoding between codepoints and bytestrings. For more elaborate operations, please use the excellent Uutf.

status: experimental

  • since 2.1
type uchar = Stdlib.Uchar.t
type 'a gen = unit -> 'a option
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type t = private string

A UTF8 string

val equal : t -> t -> bool
val hash : t -> int
val compare : t -> t -> int
val pp : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string

Identity.

exception Malformed of string * int

Malformed string at given offset

val to_gen : ?idx:int -> t -> uchar gen

Generator of unicode codepoints.

  • parameter idx

    offset where to start the decoding.

val to_iter : ?idx:int -> t -> uchar iter

Iterator of unicode codepoints.

  • parameter idx

    offset where to start the decoding.

  • since 2.8
val to_seq : ?idx:int -> t -> uchar Stdlib.Seq.t

Iter of unicode codepoints. Renamed from to_std_seq since 3.0.

  • parameter idx

    offset where to start the decoding.

  • since 3.0
val to_list : ?idx:int -> t -> uchar list

List of unicode codepoints.

  • parameter idx

    offset where to start the decoding.

val fold : ?idx:int -> ( 'a -> uchar -> 'a ) -> 'a -> t -> 'a
val iter : ?idx:int -> ( uchar -> unit ) -> t -> unit
val n_chars : t -> int

Number of characters.

val n_bytes : t -> int

Number of bytes.

val map : ( uchar -> uchar ) -> t -> t
val filter_map : ( uchar -> uchar option ) -> t -> t
val flat_map : ( uchar -> t ) -> t -> t
val empty : t

Empty string.

  • since 3.5
val append : t -> t -> t

Append two string together.

val concat : t -> t list -> t

concat sep l concatenates each string in l, inserting sep in between each string. Similar to String.concat.

val of_uchar : uchar -> t

of_char c is a string with only one unicode char in it.

  • since 3.5
val make : int -> uchar -> t

make n c makes a new string with n copies of c in it.

  • since 3.5
val of_seq : uchar Stdlib.Seq.t -> t

Build a string from unicode codepoints Renamed from of_std_seq since 3.0.

  • since 3.0
val of_iter : uchar iter -> t

Build a string from unicode codepoints

  • since 2.8
val uchar_to_bytes : uchar -> char iter

Translate the unicode codepoint to a list of utf-8 bytes. This can be used, for example, in combination with Buffer.add_char on a pre-allocated buffer to add the bytes one by one (despite its name, Buffer.add_char takes individual bytes, not unicode codepoints).

  • since 3.2
val of_gen : uchar gen -> t
val of_list : uchar list -> t
val of_string_exn : string -> t

Validate string by checking it is valid UTF8.

  • raises Invalid_argument

    if the string is not valid UTF8.

val of_string : string -> t option

Safe version of of_string_exn.

val is_valid : string -> bool

Valid UTF8?

val unsafe_of_string : string -> t

Conversion from a string without validating. CAUTION this is unsafe and can break all the other functions in this module. Use only if you're sure the string is valid UTF8. Upon iteration, if an invalid substring is met, Malformed will be raised.

\ No newline at end of file +CCUtf8_string (containers.CCUtf8_string)

Module CCUtf8_string

Unicode String, in UTF8

A unicode string represented by a utf8 bytestring. This representation is convenient for manipulating normal OCaml strings that are encoded in UTF8.

We perform only basic decoding and encoding between codepoints and bytestrings. For more elaborate operations, please use the excellent Uutf.

status: experimental

  • since 2.1
type uchar = Stdlib.Uchar.t
type 'a gen = unit -> 'a option
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type t = private string

A UTF8 string

val equal : t -> t -> bool
val hash : t -> int
val compare : t -> t -> int
val pp : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string

Identity.

exception Malformed of string * int

Malformed string at given offset

val to_gen : ?idx:int -> t -> uchar gen

Generator of unicode codepoints.

  • parameter idx

    offset where to start the decoding.

val to_iter : ?idx:int -> t -> uchar iter

Iterator of unicode codepoints.

  • parameter idx

    offset where to start the decoding.

  • since 2.8
val to_seq : ?idx:int -> t -> uchar Stdlib.Seq.t

Iter of unicode codepoints. Renamed from to_std_seq since 3.0.

  • parameter idx

    offset where to start the decoding.

  • since 3.0
val to_list : ?idx:int -> t -> uchar list

List of unicode codepoints.

  • parameter idx

    offset where to start the decoding.

val fold : ?idx:int -> ( 'a -> uchar -> 'a ) -> 'a -> t -> 'a
val iter : ?idx:int -> ( uchar -> unit ) -> t -> unit
val n_chars : t -> int

Number of characters.

val n_bytes : t -> int

Number of bytes.

val map : ( uchar -> uchar ) -> t -> t
val filter_map : ( uchar -> uchar option ) -> t -> t
val flat_map : ( uchar -> t ) -> t -> t
val empty : t

Empty string.

  • since 3.5
val append : t -> t -> t

Append two string together.

val concat : t -> t list -> t

concat sep l concatenates each string in l, inserting sep in between each string. Similar to String.concat.

val of_uchar : uchar -> t

of_char c is a string with only one unicode char in it.

  • since 3.5
val make : int -> uchar -> t

make n c makes a new string with n copies of c in it.

  • since 3.5
val of_seq : uchar Stdlib.Seq.t -> t

Build a string from unicode codepoints Renamed from of_std_seq since 3.0.

  • since 3.0
val of_iter : uchar iter -> t

Build a string from unicode codepoints

  • since 2.8
val uchar_to_bytes : uchar -> char iter

Translate the unicode codepoint to a list of utf-8 bytes. This can be used, for example, in combination with Buffer.add_char on a pre-allocated buffer to add the bytes one by one (despite its name, Buffer.add_char takes individual bytes, not unicode codepoints).

  • since 3.2
val of_gen : uchar gen -> t
val of_list : uchar list -> t
val of_string_exn : string -> t

Validate string by checking it is valid UTF8.

  • raises Invalid_argument

    if the string is not valid UTF8.

val of_string : string -> t option

Safe version of of_string_exn.

val is_valid : string -> bool

Valid UTF8?

val unsafe_of_string : string -> t

Conversion from a string without validating. CAUTION this is unsafe and can break all the other functions in this module. Use only if you're sure the string is valid UTF8. Upon iteration, if an invalid substring is met, Malformed will be raised.

\ No newline at end of file diff --git a/dev/containers/CCVector/index.html b/dev/containers/CCVector/index.html index 37dee65f..899bced2 100644 --- a/dev/containers/CCVector/index.html +++ b/dev/containers/CCVector/index.html @@ -1,5 +1,5 @@ -CCVector (containers.CCVector)

Module CCVector

Growable, mutable vector

type ro = [
| `RO
]
type rw = [
| `RW
]

Mutability is rw (read-write) or ro (read-only).

type ('a, 'mut) t

The type of a vector of elements of type 'a, with a mutability flat 'mut.

type 'a vector = ( 'a, rw ) t

Type synonym: a 'a vector is mutable.

type 'a ro_vector = ( 'a, ro ) t

Alias for immutable vectors.

  • since 0.15
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val freeze : ( 'a, _ ) t -> ( 'a, ro ) t

Make an immutable vector (no copy! Don't use the old version).

val freeze_copy : ( 'a, _ ) t -> ( 'a, ro ) t

Copy the vector into an immutable version.

val create : unit -> ( 'a, rw ) t

Create a new, empty vector.

val create_with : ?capacity:int -> 'a -> ( 'a, rw ) t

Create a new vector, the value is used to enforce the type the new vector.

  • parameter capacity

    the size of the underlying array.

val return : 'a -> ( 'a, 'mut ) t

Singleton vector.

  • since 0.14
val make : int -> 'a -> ( 'a, 'mut ) t

make n x makes a vector of size n, filled with x.

val init : int -> ( int -> 'a ) -> ( 'a, 'mut ) t

Init the vector with the given function and size.

val clear : ( 'a, rw ) t -> unit

Clear the content of the vector. This ensures that length v = 0 but the underlying array is kept, and possibly references to former elements, which are therefore not garbage collectible.

val clear_and_reset : ( 'a, rw ) t -> unit

Clear the content of the vector, and deallocate the underlying array, removing references to all the elements. The elements can be collected.

  • since 2.8
val ensure_with : init:'a -> ( 'a, rw ) t -> int -> unit

Hint to the vector that it should have at least the given capacity. This does not affect length v.

  • parameter init

    if capacity v = 0, used to enforce the type of the vector (see create_with).

  • raises Invalid_arg

    if the size is not suitable (negative, or too big for OCaml arrays)

  • since 0.14
val ensure : ( 'a, rw ) t -> int -> unit

Hint to the vector that it should have at least the given capacity. Just a hint, will not be enforced if the vector is empty and init is not provided.

  • raises Invalid_arg

    if the size is not suitable (negative, or too big for OCaml arrays)

val is_empty : ( 'a, _ ) t -> bool

Is the vector empty?

val push : ( 'a, rw ) t -> 'a -> unit

Add an element at the end of the vector.

val resize_with : ( 'a, rw ) t -> ( int -> 'a ) -> int -> unit

resize_with vec f size resizes vector vec up to size, fills vector with calls to f on indexes [vec.size-1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.

  • raises Invalid_argument

    if the size is too big

  • since 3.7
val resize_with_init : ( 'a, rw ) t -> init:'a -> int -> unit

resize_with_init vec init size resizes vector vec up to size, fills vector with calls to init on indexes [length vec -1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.

  • raises Invalid_argument

    if the size is too big

  • since 3.7
val append : ( 'a, rw ) t -> ( 'a, _ ) t -> unit

append a b adds all elements of b to a.

val append_array : ( 'a, rw ) t -> 'a array -> unit

Like append, with an array.

val append_iter : ( 'a, rw ) t -> 'a iter -> unit

Append content of iterator.

  • since 2.8
val append_seq : ( 'a, rw ) t -> 'a Stdlib.Seq.t -> unit

Append content of iterator. Renamed from append_std_seq since 3.0.

  • since 3.0
val append_list : ( 'a, rw ) t -> 'a list -> unit

Append content of list.

  • since 0.14
val append_gen : ( 'a, rw ) t -> 'a gen -> unit

Append content of generator.

  • since 0.20
val equal : 'a equal -> ( 'a, _ ) t equal
val compare : 'a ord -> ( 'a, _ ) t ord

Total ordering on vectors. Lexicographic comparison.

exception Empty

Raised on empty stack.

val pop : ( 'a, rw ) t -> 'a option

Remove last element, or None.

val pop_exn : ( 'a, rw ) t -> 'a

Remove last element, or raise an exception if empty.

  • raises Empty

    on an empty vector.

val top : ( 'a, _ ) t -> 'a option

Top element, if present.

  • since 0.6
val top_exn : ( 'a, _ ) t -> 'a

Top element, if present.

  • raises Empty

    on an empty vector.

  • since 0.6
val copy : ( 'a, _ ) t -> ( 'a, 'mut ) t

Shallow copy (may give an immutable or mutable vector).

val truncate : ( 'a, rw ) t -> int -> unit

Truncate to the given size (remove elements above this size). Does nothing if the parameter is bigger than the current size. truncate was called shrink.

  • since 3.0
val shrink_to_fit : ( 'a, _ ) t -> unit

Shrink internal array to fit the size of the vector

  • since 2.8
val member : eq:( 'a -> 'a -> bool ) -> 'a -> ( 'a, _ ) t -> bool

Is the element a member of the vector?

val sort : ( 'a -> 'a -> int ) -> ( 'a, _ ) t -> ( 'a, 'mut ) t

Sort the vector, returning a copy of it that is sorted w.r.t the given ordering. The vector itself is unchanged. The underlying array of the new vector can be smaller than the original one.

val sort' : ( 'a -> 'a -> int ) -> ( 'a, rw ) t -> unit

Sort the vector in place (modifying it). This function change the size of the underlying array.

val uniq_sort : ( 'a -> 'a -> int ) -> ( 'a, rw ) t -> unit

Sort the array and remove duplicates, in place (e.g. modifying the vector itself).

val iter : ( 'a -> unit ) -> ( 'a, _ ) t -> unit

Iterate on the vector's content.

val iteri : ( int -> 'a -> unit ) -> ( 'a, _ ) t -> unit

Iterate on the vector, with indexes.

val map : ( 'a -> 'b ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Map elements of the vector, yielding a new vector.

val mapi : ( int -> 'a -> 'b ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

map f v is just like map, but it also passes in the index of each element as the first argument to the function f.

  • since 2.8
val map_in_place : ( 'a -> 'a ) -> ( 'a, _ ) t -> unit

Map elements of the vector in place

  • since 2.3
val filter : ( 'a -> bool ) -> ( 'a, _ ) t -> ( 'a, 'mut ) t

Filter elements from the vector. filter p v leaves v unchanged but returns a new vector that only contains elements of v satisfying p.

val filter_in_place : ( 'a -> bool ) -> ( 'a, rw ) t -> unit

Filter elements from the vector in place.

  • since 3.0
val fold : ( 'b -> 'a -> 'b ) -> 'b -> ( 'a, _ ) t -> 'b

Fold on elements of the vector

val exists : ( 'a -> bool ) -> ( 'a, _ ) t -> bool

Existential test (is there an element that satisfies the predicate?).

val for_all : ( 'a -> bool ) -> ( 'a, _ ) t -> bool

Universal test (do all the elements satisfy the predicate?).

val find : ( 'a -> bool ) -> ( 'a, _ ) t -> 'a option

Find an element that satisfies the predicate.

val find_exn : ( 'a -> bool ) -> ( 'a, _ ) t -> 'a

Find an element that satisfies the predicate, or

  • raises Not_found

    if no element does.

val find_map : ( 'a -> 'b option ) -> ( 'a, _ ) t -> 'b option

find_map f v returns the first Some y = f x for x in v, or None if f x = None for each x in v.

  • since 0.14
val filter_map : ( 'a -> 'b option ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Map elements with a function, possibly filtering some of them out.

val filter_map_in_place : ( 'a -> 'a option ) -> ( 'a, _ ) t -> unit

Filter-map elements of the vector in place

  • since 2.3
val flat_map : ( 'a -> ( 'b, _ ) t ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Map each element to a sub-vector.

val flat_map_seq : ( 'a -> 'b Stdlib.Seq.t ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Like flat_map, but using Seq for intermediate collections. Renamed from flat_map_std_seq since 3.0.

  • since 3.0
val flat_map_list : ( 'a -> 'b list ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Like flat_map, but using list for intermediate collections.

  • since 0.14
val monoid_product : +CCVector (containers.CCVector)

Module CCVector

Growable, mutable vector

type ro = [
| `RO
]
type rw = [
| `RW
]

Mutability is rw (read-write) or ro (read-only).

type ('a, 'mut) t

The type of a vector of elements of type 'a, with a mutability flat 'mut.

type 'a vector = ( 'a, rw ) t

Type synonym: a 'a vector is mutable.

type 'a ro_vector = ( 'a, ro ) t

Alias for immutable vectors.

  • since 0.15
type 'a iter = ( 'a -> unit ) -> unit

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val freeze : ( 'a, _ ) t -> ( 'a, ro ) t

Make an immutable vector (no copy! Don't use the old version).

val freeze_copy : ( 'a, _ ) t -> ( 'a, ro ) t

Copy the vector into an immutable version.

val create : unit -> ( 'a, rw ) t

Create a new, empty vector.

val create_with : ?capacity:int -> 'a -> ( 'a, rw ) t

Create a new vector, the value is used to enforce the type the new vector.

  • parameter capacity

    the size of the underlying array.

val return : 'a -> ( 'a, 'mut ) t

Singleton vector.

  • since 0.14
val make : int -> 'a -> ( 'a, 'mut ) t

make n x makes a vector of size n, filled with x.

val init : int -> ( int -> 'a ) -> ( 'a, 'mut ) t

Init the vector with the given function and size.

val clear : ( 'a, rw ) t -> unit

Clear the content of the vector. This ensures that length v = 0 but the underlying array is kept, and possibly references to former elements, which are therefore not garbage collectible.

val clear_and_reset : ( 'a, rw ) t -> unit

Clear the content of the vector, and deallocate the underlying array, removing references to all the elements. The elements can be collected.

  • since 2.8
val ensure_with : init:'a -> ( 'a, rw ) t -> int -> unit

Hint to the vector that it should have at least the given capacity. This does not affect length v.

  • parameter init

    if capacity v = 0, used to enforce the type of the vector (see create_with).

  • raises Invalid_arg

    if the size is not suitable (negative, or too big for OCaml arrays)

  • since 0.14
val ensure : ( 'a, rw ) t -> int -> unit

Hint to the vector that it should have at least the given capacity. Just a hint, will not be enforced if the vector is empty and init is not provided.

  • raises Invalid_arg

    if the size is not suitable (negative, or too big for OCaml arrays)

val is_empty : ( 'a, _ ) t -> bool

Is the vector empty?

val push : ( 'a, rw ) t -> 'a -> unit

Add an element at the end of the vector.

val resize_with : ( 'a, rw ) t -> ( int -> 'a ) -> int -> unit

resize_with vec f size resizes vector vec up to size, fills vector with calls to f on indexes [vec.size-1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.

  • raises Invalid_argument

    if the size is too big

  • since 3.7
val resize_with_init : ( 'a, rw ) t -> init:'a -> int -> unit

resize_with_init vec init size resizes vector vec up to size, fills vector with calls to init on indexes [length vec -1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.

  • raises Invalid_argument

    if the size is too big

  • since 3.7
val append : ( 'a, rw ) t -> ( 'a, _ ) t -> unit

append a b adds all elements of b to a.

val append_array : ( 'a, rw ) t -> 'a array -> unit

Like append, with an array.

val append_iter : ( 'a, rw ) t -> 'a iter -> unit

Append content of iterator.

  • since 2.8
val append_seq : ( 'a, rw ) t -> 'a Stdlib.Seq.t -> unit

Append content of iterator. Renamed from append_std_seq since 3.0.

  • since 3.0
val append_list : ( 'a, rw ) t -> 'a list -> unit

Append content of list.

  • since 0.14
val append_gen : ( 'a, rw ) t -> 'a gen -> unit

Append content of generator.

  • since 0.20
val equal : 'a equal -> ( 'a, _ ) t equal
val compare : 'a ord -> ( 'a, _ ) t ord

Total ordering on vectors. Lexicographic comparison.

exception Empty

Raised on empty stack.

val pop : ( 'a, rw ) t -> 'a option

Remove last element, or None.

val pop_exn : ( 'a, rw ) t -> 'a

Remove last element, or raise an exception if empty.

  • raises Empty

    on an empty vector.

val top : ( 'a, _ ) t -> 'a option

Top element, if present.

  • since 0.6
val top_exn : ( 'a, _ ) t -> 'a

Top element, if present.

  • raises Empty

    on an empty vector.

  • since 0.6
val copy : ( 'a, _ ) t -> ( 'a, 'mut ) t

Shallow copy (may give an immutable or mutable vector).

val truncate : ( 'a, rw ) t -> int -> unit

Truncate to the given size (remove elements above this size). Does nothing if the parameter is bigger than the current size. truncate was called shrink.

  • since 3.0
val shrink_to_fit : ( 'a, _ ) t -> unit

Shrink internal array to fit the size of the vector

  • since 2.8
val member : eq:( 'a -> 'a -> bool ) -> 'a -> ( 'a, _ ) t -> bool

Is the element a member of the vector?

val sort : ( 'a -> 'a -> int ) -> ( 'a, _ ) t -> ( 'a, 'mut ) t

Sort the vector, returning a copy of it that is sorted w.r.t the given ordering. The vector itself is unchanged. The underlying array of the new vector can be smaller than the original one.

val sort' : ( 'a -> 'a -> int ) -> ( 'a, rw ) t -> unit

Sort the vector in place (modifying it). This function change the size of the underlying array.

val uniq_sort : ( 'a -> 'a -> int ) -> ( 'a, rw ) t -> unit

Sort the array and remove duplicates, in place (e.g. modifying the vector itself).

val iter : ( 'a -> unit ) -> ( 'a, _ ) t -> unit

Iterate on the vector's content.

val iteri : ( int -> 'a -> unit ) -> ( 'a, _ ) t -> unit

Iterate on the vector, with indexes.

val map : ( 'a -> 'b ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Map elements of the vector, yielding a new vector.

val mapi : ( int -> 'a -> 'b ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

map f v is just like map, but it also passes in the index of each element as the first argument to the function f.

  • since 2.8
val map_in_place : ( 'a -> 'a ) -> ( 'a, _ ) t -> unit

Map elements of the vector in place

  • since 2.3
val filter : ( 'a -> bool ) -> ( 'a, _ ) t -> ( 'a, 'mut ) t

Filter elements from the vector. filter p v leaves v unchanged but returns a new vector that only contains elements of v satisfying p.

val filter_in_place : ( 'a -> bool ) -> ( 'a, rw ) t -> unit

Filter elements from the vector in place.

  • since 3.0
val fold : ( 'b -> 'a -> 'b ) -> 'b -> ( 'a, _ ) t -> 'b

Fold on elements of the vector

val exists : ( 'a -> bool ) -> ( 'a, _ ) t -> bool

Existential test (is there an element that satisfies the predicate?).

val for_all : ( 'a -> bool ) -> ( 'a, _ ) t -> bool

Universal test (do all the elements satisfy the predicate?).

val find : ( 'a -> bool ) -> ( 'a, _ ) t -> 'a option

Find an element that satisfies the predicate.

val find_exn : ( 'a -> bool ) -> ( 'a, _ ) t -> 'a

Find an element that satisfies the predicate, or

  • raises Not_found

    if no element does.

val find_map : ( 'a -> 'b option ) -> ( 'a, _ ) t -> 'b option

find_map f v returns the first Some y = f x for x in v, or None if f x = None for each x in v.

  • since 0.14
val filter_map : ( 'a -> 'b option ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Map elements with a function, possibly filtering some of them out.

val filter_map_in_place : ( 'a -> 'a option ) -> ( 'a, _ ) t -> unit

Filter-map elements of the vector in place

  • since 2.3
val flat_map : ( 'a -> ( 'b, _ ) t ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Map each element to a sub-vector.

val flat_map_seq : ( 'a -> 'b Stdlib.Seq.t ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Like flat_map, but using Seq for intermediate collections. Renamed from flat_map_std_seq since 3.0.

  • since 3.0
val flat_map_list : ( 'a -> 'b list ) -> ( 'a, _ ) t -> ( 'b, 'mut ) t

Like flat_map, but using list for intermediate collections.

  • since 0.14
val monoid_product : ( 'a -> 'b -> 'c ) -> ( 'a, _ ) t -> ( 'b, _ ) t -> diff --git a/dev/containers/Containers/Hashtbl/Make/index.html b/dev/containers/Containers/Hashtbl/Make/index.html index 6a72bb6e..68082fcf 100644 --- a/dev/containers/Containers/Hashtbl/Make/index.html +++ b/dev/containers/Containers/Hashtbl/Make/index.html @@ -1,2 +1,2 @@ -Make (containers.Containers.Hashtbl.Make)

Module Hashtbl.Make

Parameters

module H : Stdlib__Hashtbl.HashedType

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 +Make (containers.Containers.Hashtbl.Make)

Module Hashtbl.Make

Parameters

module H : Stdlib__Hashtbl.HashedType

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/index.html b/dev/containers/Containers/Hashtbl/MakeSeeded/index.html index 5e876b66..3ce331c5 100644 --- a/dev/containers/Containers/Hashtbl/MakeSeeded/index.html +++ b/dev/containers/Containers/Hashtbl/MakeSeeded/index.html @@ -1,2 +1,2 @@ -MakeSeeded (containers.Containers.Hashtbl.MakeSeeded)

Module Hashtbl.MakeSeeded

Parameters

module H : SeededHashedType

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 +MakeSeeded (containers.Containers.Hashtbl.MakeSeeded)

Module Hashtbl.MakeSeeded

Parameters

module H : SeededHashedType

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 index 471393ba..a5b57295 100644 --- a/dev/containers/Containers/Hashtbl/index.html +++ b/dev/containers/Containers/Hashtbl/index.html @@ -1,5 +1,5 @@ -Hashtbl (containers.Containers.Hashtbl)

Module Containers.Hashtbl

  • since 0.14
include module type of Stdlib.Hashtbl +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 (!'a, !'b) 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 = {
num_bindings : int;
num_buckets : int;
max_bucket_length : int;
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 : Stdlib__Hashtbl.HashedType) : 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 : diff --git a/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html b/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html index 8ee352a2..7882dbde 100644 --- a/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html +++ b/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html @@ -1,2 +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 +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 index d16c48f8..8c4974be 100644 --- a/dev/containers/Containers/Hashtbl/module-type-S/index.html +++ b/dev/containers/Containers/Hashtbl/module-type-S/index.html @@ -1,2 +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 +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 index c4c27571..7e00f800 100644 --- a/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html +++ b/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html @@ -1,2 +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 +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 index 81b78828..63ac40b3 100644 --- a/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html +++ b/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html @@ -1,2 +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 +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/Containers/index.html b/dev/containers/Containers/index.html index 1042fe88..3dce7805 100644 --- a/dev/containers/Containers/index.html +++ b/dev/containers/Containers/index.html @@ -1,2 +1,2 @@ -Containers (containers.Containers)

Module Containers

Drop-In replacement to Stdlib

module Array = CCArray
module Bool = CCBool
module Byte_buffer = CCByte_buffer
module Char = CCChar
module Equal = CCEqual
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCList
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOption
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCString
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Unit = CCUnit
module Atomic = CCAtomic
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Canonical_sexp = CCCanonical_sexp
module Stdlib = CCShims_.Stdlib
include module type of struct include Monomorphic end

Shadow unsafe functions and operators from Stdlib

  • since 2.0
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
  • since 2.1
val (<>.) : float -> float -> bool
  • since 2.1
val (<.) : float -> float -> bool
  • since 2.1
val (>.) : float -> float -> bool
  • since 2.1
val (<=.) : float -> float -> bool
  • since 2.1
val (>=.) : float -> float -> bool
  • since 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
  • since 2.1
\ No newline at end of file +Containers (containers.Containers)

Module Containers

Drop-In replacement to Stdlib

module Array = CCArray
module Bool = CCBool
module Byte_buffer = CCByte_buffer
module Char = CCChar
module Equal = CCEqual
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCList
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOption
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCString
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Unit = CCUnit
module Atomic = CCAtomic
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Canonical_sexp = CCCanonical_sexp
module Stdlib = CCShims_.Stdlib
include module type of struct include Monomorphic end

Shadow unsafe functions and operators from Stdlib

  • since 2.0
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
  • since 2.1
val (<>.) : float -> float -> bool
  • since 2.1
val (<.) : float -> float -> bool
  • since 2.1
val (>.) : float -> float -> bool
  • since 2.1
val (<=.) : float -> float -> bool
  • since 2.1
val (>=.) : float -> float -> bool
  • since 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
  • since 2.1
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/Hashtbl/Make/index.html b/dev/containers/ContainersLabels/Hashtbl/Make/index.html index a22fe799..04823a7b 100644 --- a/dev/containers/ContainersLabels/Hashtbl/Make/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/Make/index.html @@ -1,2 +1,2 @@ -Make (containers.ContainersLabels.Hashtbl.Make)

Module Hashtbl.Make

Parameters

module H : Stdlib__Hashtbl.HashedType

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 +Make (containers.ContainersLabels.Hashtbl.Make)

Module Hashtbl.Make

Parameters

module H : Stdlib__Hashtbl.HashedType

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/index.html b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html index fd11212b..42691ae8 100644 --- a/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html @@ -1,2 +1,2 @@ -MakeSeeded (containers.ContainersLabels.Hashtbl.MakeSeeded)

Module Hashtbl.MakeSeeded

Parameters

module H : SeededHashedType

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 +MakeSeeded (containers.ContainersLabels.Hashtbl.MakeSeeded)

Module Hashtbl.MakeSeeded

Parameters

module H : SeededHashedType

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 index cb437d51..ffef43b8 100644 --- a/dev/containers/ContainersLabels/Hashtbl/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/index.html @@ -1,5 +1,5 @@ -Hashtbl (containers.ContainersLabels.Hashtbl)

Module ContainersLabels.Hashtbl

  • since 0.14
include module type of Stdlib.Hashtbl +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 (!'a, !'b) 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 = {
num_bindings : int;
num_buckets : int;
max_bucket_length : int;
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 : Stdlib__Hashtbl.HashedType) : 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 : diff --git a/dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html b/dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html index e423bf8f..9cc71f79 100644 --- a/dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-HashedType/index.html @@ -1,2 +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 +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 index 6f4a58a4..8be31674 100644 --- a/dev/containers/ContainersLabels/Hashtbl/module-type-S/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-S/index.html @@ -1,2 +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 +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 index a388385b..4b18572d 100644 --- a/dev/containers/ContainersLabels/Hashtbl/module-type-SeededHashedType/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-SeededHashedType/index.html @@ -1,2 +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 +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 index aefb9056..cb229858 100644 --- a/dev/containers/ContainersLabels/Hashtbl/module-type-SeededS/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/module-type-SeededS/index.html @@ -1,2 +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 +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 diff --git a/dev/containers/ContainersLabels/index.html b/dev/containers/ContainersLabels/index.html index 196208d4..fc63af16 100644 --- a/dev/containers/ContainersLabels/index.html +++ b/dev/containers/ContainersLabels/index.html @@ -1,2 +1,2 @@ -ContainersLabels (containers.ContainersLabels)

Module ContainersLabels

Drop-In replacement to Stdlib

module Array = CCArrayLabels
module Bool = CCBool
module Byte_buffer = CCByte_buffer
module Char = CCChar
module Equal = CCEqualLabels
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCListLabels
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOption
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCStringLabels
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Stdlib = CCShims_.Stdlib
include module type of struct include Monomorphic end

Shadow unsafe functions and operators from Stdlib

  • since 2.0
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
  • since 2.1
val (<>.) : float -> float -> bool
  • since 2.1
val (<.) : float -> float -> bool
  • since 2.1
val (>.) : float -> float -> bool
  • since 2.1
val (<=.) : float -> float -> bool
  • since 2.1
val (>=.) : float -> float -> bool
  • since 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
  • since 2.1
\ No newline at end of file +ContainersLabels (containers.ContainersLabels)

Module ContainersLabels

Drop-In replacement to Stdlib

module Array = CCArrayLabels
module Bool = CCBool
module Byte_buffer = CCByte_buffer
module Char = CCChar
module Equal = CCEqualLabels
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCListLabels
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOption
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCStringLabels
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Stdlib = CCShims_.Stdlib
include module type of struct include Monomorphic end

Shadow unsafe functions and operators from Stdlib

  • since 2.0
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
  • since 2.1
val (<>.) : float -> float -> bool
  • since 2.1
val (<.) : float -> float -> bool
  • since 2.1
val (>.) : float -> float -> bool
  • since 2.1
val (<=.) : float -> float -> bool
  • since 2.1
val (>=.) : float -> float -> bool
  • since 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
  • since 2.1
\ No newline at end of file diff --git a/dev/containers/Containers_bencode/Decode/index.html b/dev/containers/Containers_bencode/Decode/index.html index c52ac601..f298edca 100644 --- a/dev/containers/Containers_bencode/Decode/index.html +++ b/dev/containers/Containers_bencode/Decode/index.html @@ -1,2 +1,2 @@ -Decode (containers.Containers_bencode.Decode)

Module Containers_bencode.Decode

Decoding

val of_string : string -> t option
val of_string_exn : string -> t

Parse string.

  • raises Failure

    if the string is not valid bencode.

\ No newline at end of file +Decode (containers.Containers_bencode.Decode)

Module Containers_bencode.Decode

Decoding

val of_string : string -> t option
val of_string_exn : string -> t

Parse string.

  • raises Failure

    if the string is not valid bencode.

\ No newline at end of file diff --git a/dev/containers/Containers_bencode/Encode/index.html b/dev/containers/Containers_bencode/Encode/index.html index 9ac79886..8dd91509 100644 --- a/dev/containers/Containers_bencode/Encode/index.html +++ b/dev/containers/Containers_bencode/Encode/index.html @@ -1,2 +1,2 @@ -Encode (containers.Containers_bencode.Encode)

Module Containers_bencode.Encode

Encoding

val to_string : t -> string
val to_buffer : Stdlib.Buffer.t -> t -> unit
val to_chan : Stdlib.out_channel -> t -> unit
val to_fmt : Stdlib.Format.formatter -> t -> unit
\ No newline at end of file +Encode (containers.Containers_bencode.Encode)

Module Containers_bencode.Encode

Encoding

val to_string : t -> string
val to_buffer : Stdlib.Buffer.t -> t -> unit
val to_chan : Stdlib.out_channel -> t -> unit
val to_fmt : Stdlib.Format.formatter -> t -> unit
\ No newline at end of file diff --git a/dev/containers/Containers_bencode/Str_map/index.html b/dev/containers/Containers_bencode/Str_map/index.html index bd40775d..c60c62be 100644 --- a/dev/containers/Containers_bencode/Str_map/index.html +++ b/dev/containers/Containers_bencode/Str_map/index.html @@ -1,5 +1,5 @@ -Str_map (containers.Containers_bencode.Str_map)

Module Containers_bencode.Str_map

type key = Stdlib.String.t
type !'a t = 'a Stdlib__Map.Make(Stdlib.String).t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +Str_map (containers.Containers_bencode.Str_map)

Module Containers_bencode.Str_map

type key = Stdlib.String.t
type !'a t = 'a Stdlib__Map.Make(Stdlib.String).t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ( 'a option -> 'a option ) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : ( key -> 'a option -> 'b option -> 'c option ) -> 'a t -> 'b t -> diff --git a/dev/containers/Containers_bencode/index.html b/dev/containers/Containers_bencode/index.html index 24aa8bf7..8c36d958 100644 --- a/dev/containers/Containers_bencode/index.html +++ b/dev/containers/Containers_bencode/index.html @@ -1,2 +1,2 @@ -Containers_bencode (containers.Containers_bencode)

Module Containers_bencode

Basic Bencode decoder/encoder.

See https://en.wikipedia.org/wiki/Bencode .

  • since 3.8
module Str_map : sig ... end
type t =
| Int of int64
| String of string
| List of t list
| Map of t Str_map.t
val equal : t -> t -> bool
val hash : t -> int
val pp_debug : Stdlib.Format.formatter -> t -> unit

Printer for diagnostic/human consumption

val to_string_debug : t -> string
val int : int -> t
val int64 : int64 -> t
val string : string -> t
val list : t list -> t
val map_of_list : (string * t) list -> t
val map : t Str_map.t -> t
module Encode : sig ... end

Encoding

module Decode : sig ... end

Decoding

\ No newline at end of file +Containers_bencode (containers.Containers_bencode)

Module Containers_bencode

Basic Bencode decoder/encoder.

See https://en.wikipedia.org/wiki/Bencode .

  • since 3.8
module Str_map : sig ... end
type t =
| Int of int64
| String of string
| List of t list
| Map of t Str_map.t
val equal : t -> t -> bool
val hash : t -> int
val pp_debug : Stdlib.Format.formatter -> t -> unit

Printer for diagnostic/human consumption

val to_string_debug : t -> string
val int : int -> t
val int64 : int64 -> t
val string : string -> t
val list : t list -> t
val map_of_list : (string * t) list -> t
val map : t Str_map.t -> t
module Encode : sig ... end

Encoding

module Decode : sig ... end

Decoding

\ No newline at end of file diff --git a/dev/containers/Containers_cbor/index.html b/dev/containers/Containers_cbor/index.html index b23f4815..7cafc6d8 100644 --- a/dev/containers/Containers_cbor/index.html +++ b/dev/containers/Containers_cbor/index.html @@ -1,2 +1,2 @@ -Containers_cbor (containers.Containers_cbor)

Module Containers_cbor

CBOR encoder/decoder.

The type is chosen to be compatible with ocaml-cbor. See the RFC.

note this is experimental.

note this is only available on OCaml >= 4.08. Below that, the module is empty.

  • since NEXT_RELEASE
type t = [
| `Null
| `Undefined
| `Simple of int
| `Bool of bool
| `Int of int
| `Float of float
| `Bytes of string
| `Text of string
| `Array of t list
| `Map of (t * t) list
| `Tag of int * t
]
val pp_diagnostic : t CCFormat.printer
val to_string_diagnostic : t -> string
val encode : ?buf:Stdlib.Buffer.t -> t -> string
val decode : string -> ( t, string ) Stdlib.result
val decode_exn : string -> t

Like decode.

  • raises Failure

    if the string isn't valid

\ No newline at end of file +Containers_cbor (containers.Containers_cbor)

Module Containers_cbor

CBOR encoder/decoder.

The type is chosen to be compatible with ocaml-cbor. See the RFC.

note this is experimental.

note this is only available on OCaml >= 4.08. Below that, the module is empty.

  • since NEXT_RELEASE
type t = [
| `Null
| `Undefined
| `Simple of int
| `Bool of bool
| `Int of int
| `Float of float
| `Bytes of string
| `Text of string
| `Array of t list
| `Map of (t * t) list
| `Tag of int * t
]
val pp_diagnostic : t CCFormat.printer
val to_string_diagnostic : t -> string
val encode : ?buf:Stdlib.Buffer.t -> t -> string
val decode : string -> ( t, string ) Stdlib.result
val decode_exn : string -> t

Like decode.

  • raises Failure

    if the string isn't valid

\ No newline at end of file diff --git a/dev/containers/Containers_codegen/Bitfield/index.html b/dev/containers/Containers_codegen/Bitfield/index.html index cc04a271..8fb94337 100644 --- a/dev/containers/Containers_codegen/Bitfield/index.html +++ b/dev/containers/Containers_codegen/Bitfield/index.html @@ -1,2 +1,2 @@ -Bitfield (containers.Containers_codegen.Bitfield)

Module Containers_codegen.Bitfield

Generate efficient bitfields that fit in an integer

type t
val make : ?emit_failure_if_too_wide:bool -> name:string -> unit -> t

Make a new bitfield with the given name.

  • parameter name

    the name of the generated type

  • parameter emit_failure_if_too_wide

    if true, generated code includes a runtime assertion that Sys.int_size is wide enough to support this type

val field_bit : t -> string -> unit

field_bit ty name adds a field of size 1 to the bitfield ty, with name name. The generate code will provide get/set for a boolean.

val field_int : t -> width:int -> string -> unit

field_int ty name ~width adds a field of size width to the bitfield with name name. The accessors will be for integers of width bits, and the setter might assert that the provided integer fits.

val total_width : t -> int

Total width in bits of the given bitfield.

val gen_mli : t -> code

Generate code for the type signature for the given bitfield

val gen_ml : t -> code

Generate code for the implementation for the given bitfield

\ No newline at end of file +Bitfield (containers.Containers_codegen.Bitfield)

Module Containers_codegen.Bitfield

Generate efficient bitfields that fit in an integer

type t
val make : ?emit_failure_if_too_wide:bool -> name:string -> unit -> t

Make a new bitfield with the given name.

  • parameter name

    the name of the generated type

  • parameter emit_failure_if_too_wide

    if true, generated code includes a runtime assertion that Sys.int_size is wide enough to support this type

val field_bit : t -> string -> unit

field_bit ty name adds a field of size 1 to the bitfield ty, with name name. The generate code will provide get/set for a boolean.

val field_int : t -> width:int -> string -> unit

field_int ty name ~width adds a field of size width to the bitfield with name name. The accessors will be for integers of width bits, and the setter might assert that the provided integer fits.

val total_width : t -> int

Total width in bits of the given bitfield.

val gen_mli : t -> code

Generate code for the type signature for the given bitfield

val gen_ml : t -> code

Generate code for the implementation for the given bitfield

\ No newline at end of file diff --git a/dev/containers/Containers_codegen/Code/index.html b/dev/containers/Containers_codegen/Code/index.html index 211638a0..7fb791b7 100644 --- a/dev/containers/Containers_codegen/Code/index.html +++ b/dev/containers/Containers_codegen/Code/index.html @@ -1,2 +1,2 @@ -Code (containers.Containers_codegen.Code)

Module Containers_codegen.Code

Representation of OCaml code

type t = code
val pp : t Fmt.printer
val to_string : t -> string
val mk_pp : unit Fmt.printer -> t
val mk_str : string -> t
val in_struct : string -> t list -> t
val in_sig : string -> t list -> t
\ No newline at end of file +Code (containers.Containers_codegen.Code)

Module Containers_codegen.Code

Representation of OCaml code

type t = code
val pp : t Fmt.printer
val to_string : t -> string
val mk_pp : unit Fmt.printer -> t
val mk_str : string -> t
val in_struct : string -> t list -> t
val in_sig : string -> t list -> t
\ No newline at end of file diff --git a/dev/containers/Containers_codegen/index.html b/dev/containers/Containers_codegen/index.html index 3dfba406..8634ece6 100644 --- a/dev/containers/Containers_codegen/index.html +++ b/dev/containers/Containers_codegen/index.html @@ -1,5 +1,5 @@ -Containers_codegen (containers.Containers_codegen)

Module Containers_codegen

Code generators

The code generator library is designed to be used from a build system (for example, from dune) to generate efficient code for features that are harder to provide at runtime.

The idea is that the build system should invoke some OCaml script that depends on containers.codegen; the script uses the DSL below to describe what code to generate (e.g. a description of a bitfield type) and emits a .ml file (and possibly a .mli file).

For example, the build script might contain:

module CG = Containers_codegen
+Containers_codegen (containers.Containers_codegen)

Module Containers_codegen

Code generators

The code generator library is designed to be used from a build system (for example, from dune) to generate efficient code for features that are harder to provide at runtime.

The idea is that the build system should invoke some OCaml script that depends on containers.codegen; the script uses the DSL below to describe what code to generate (e.g. a description of a bitfield type) and emits a .ml file (and possibly a .mli file).

For example, the build script might contain:

module CG = Containers_codegen
 let () =
   let module B = CG.Bitfield in
   let b = B.make ~name:"t" () in
diff --git a/dev/containers/Containers_top/index.html b/dev/containers/Containers_top/index.html
index aac780b7..370decd7 100644
--- a/dev/containers/Containers_top/index.html
+++ b/dev/containers/Containers_top/index.html
@@ -1,2 +1,2 @@
 
-Containers_top (containers.Containers_top)

Module Containers_top

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val eval_exn : string -> bool
val install_printer : string -> unit
val install_printers : string list -> unit
\ No newline at end of file +Containers_top (containers.Containers_top)

Module Containers_top

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
val eval_exn : string -> bool
val install_printer : string -> unit
val install_printers : string list -> unit
\ No newline at end of file diff --git a/dev/containers/index.html b/dev/containers/index.html index 999af188..e57835cf 100644 --- a/dev/containers/index.html +++ b/dev/containers/index.html @@ -1,2 +1,2 @@ -index (containers.index)

containers index

Library containers

This library exposes the following toplevel modules:

Library containers.bencode

The entry point of this library is the module: Containers_bencode.

Library containers.cbor

The entry point of this library is the module: Containers_cbor.

Library containers.codegen

The entry point of this library is the module: Containers_codegen.

Library containers.monomorphic

The entry point of this library is the module: CCMonomorphic.

Library containers.top

The entry point of this library is the module: Containers_top.

Library containers.unix

The entry point of this library is the module: CCUnix.

\ No newline at end of file +index (containers.index)

containers index

Library containers

This library exposes the following toplevel modules:

Library containers.bencode

The entry point of this library is the module: Containers_bencode.

Library containers.cbor

The entry point of this library is the module: Containers_cbor.

Library containers.codegen

The entry point of this library is the module: Containers_codegen.

Library containers.monomorphic

The entry point of this library is the module: CCMonomorphic.

Library containers.top

The entry point of this library is the module: Containers_top.

Library containers.unix

The entry point of this library is the module: CCUnix.

\ No newline at end of file diff --git a/dev/odoc.css b/dev/odoc.css index 5362774e..edc8a2b3 100644 --- a/dev/odoc.css +++ b/dev/odoc.css @@ -1,7 +1,7 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 2.1.0 */ + odoc 2.1.1 */ /* Fonts */ @import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500');