From aec2dd1b9f17e35621e86c7423ef659e070d4f60 Mon Sep 17 00:00:00 2001 From: c-cube Date: Mon, 4 Jul 2022 18:01:56 +0000 Subject: [PATCH] deploy: 69f2805f1073c4ebd1063bbd58380d17e62f6324 --- dev/containers-data/CCMixtbl/index.html | 14 +++++++------- dev/containers-thread/CCTimer/index.html | 2 +- dev/containers-thread/index.html | 2 +- dev/containers/CCEqualLabels/index.html | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dev/containers-data/CCMixtbl/index.html b/dev/containers-data/CCMixtbl/index.html index e562a5b2..b090a21c 100644 --- a/dev/containers-data/CCMixtbl/index.html +++ b/dev/containers-data/CCMixtbl/index.html @@ -3,20 +3,20 @@ let tbl = CCMixtbl.create 10 ;; -OUnit2.assert_equal None (CCMixtbl.get ~inj:inj_int tbl "a");; +assert_equal None (CCMixtbl.get ~inj:inj_int tbl "a");; CCMixtbl.set inj_int tbl "a" 1;; -OUnit2.assert_equal (Some 1) (CCMixtbl.get ~inj:inj_int tbl "a");; +assert_equal (Some 1) (CCMixtbl.get ~inj:inj_int tbl "a");; let inj_string = CCMixtbl.create_inj () ;; CCMixtbl.set inj_string tbl "b" "Hello"; -OUnit2.assert_equal (Some "Hello") (CCMixtbl.get inj_string tbl "b");; -OUnit2.assert_equal None (CCMixtbl.get inj_string tbl "a");; -OUnit2.assert_equal (Some 1) (CCMixtbl.get inj_int tbl "a");; +assert_equal (Some "Hello") (CCMixtbl.get inj_string tbl "b");; +assert_equal None (CCMixtbl.get inj_string tbl "a");; +assert_equal (Some 1) (CCMixtbl.get inj_int tbl "a");; CCMixtbl.set inj_string tbl "a" "Bye";; -OUnit2.assert_equal None (CCMixtbl.get inj_int tbl "a");; -OUnit2.assert_equal (Some "Bye") (CCMixtbl.get inj_string tbl "a");;
type 'a t

A hash table containing values of different types. The type parameter 'a represents the type of the keys.

type 'b injection

An accessor for values of type 'b in any table. Values put in the table using a key can only be retrieved using this very same key.

val create : int -> 'a t

create n creates a hash table of initial size n.

val create_inj : unit -> 'b injection

Return a value that works for a given type of values. This function is normally called once for each type of value. Several keys may be created for the same type, but a value set with a given setter can only be retrieved with the matching getter. The same key can be reused across multiple tables (although not in a thread-safe way).

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

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

val set : inj:'b injection -> 'a t -> 'a -> 'b -> unit

Bind the key to the value, using inj.

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

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 length : 'a t -> int

Number of bindings.

val clear : 'a t -> unit

Clear content of the hashtable.

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

Remove the binding for this key.

val copy : 'a t -> 'a t

Copy of the table.

val mem : inj:_ injection -> 'a t -> 'a -> bool

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

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

Iterate on the keys of this table.

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

Fold over the keys.

Iterators

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

All the keys.

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

All the bindings that come from the corresponding injection.

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

Iterate on all bindings.

\ No newline at end of file +assert_equal None (CCMixtbl.get inj_int tbl "a");; +assert_equal (Some "Bye") (CCMixtbl.get inj_string tbl "a");;
type 'a t

A hash table containing values of different types. The type parameter 'a represents the type of the keys.

type 'b injection

An accessor for values of type 'b in any table. Values put in the table using a key can only be retrieved using this very same key.

val create : int -> 'a t

create n creates a hash table of initial size n.

val create_inj : unit -> 'b injection

Return a value that works for a given type of values. This function is normally called once for each type of value. Several keys may be created for the same type, but a value set with a given setter can only be retrieved with the matching getter. The same key can be reused across multiple tables (although not in a thread-safe way).

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

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

val set : inj:'b injection -> 'a t -> 'a -> 'b -> unit

Bind the key to the value, using inj.

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

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 length : 'a t -> int

Number of bindings.

val clear : 'a t -> unit

Clear content of the hashtable.

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

Remove the binding for this key.

val copy : 'a t -> 'a t

Copy of the table.

val mem : inj:_ injection -> 'a t -> 'a -> bool

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

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

Iterate on the keys of this table.

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

Fold over the keys.

Iterators

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

All the keys.

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

All the bindings that come from the corresponding injection.

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

Iterate on all bindings.

\ No newline at end of file diff --git a/dev/containers-thread/CCTimer/index.html b/dev/containers-thread/CCTimer/index.html index e77d9124..9fc88193 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.

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.

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 8fccb3bb..1aef78ae 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/CCEqualLabels/index.html b/dev/containers/CCEqualLabels/index.html index aa100701..80c668f4 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)

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.

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)

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