From 010f5e7f47956b118dca4c197efb1cbe79c21d96 Mon Sep 17 00:00:00 2001 From: c-cube Date: Tue, 7 Feb 2023 17:45:25 +0000 Subject: [PATCH] deploy: 161c192bff0cba57b122d9f3b1ee49aa44f12e58 --- 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/CCFun/Infix/index.html | 2 +- dev/containers/CCFun/index.html | 2 +- dev/index.html | 6 +++--- 6 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 dev/containers-data/CCHet/Key/index.html create mode 100644 dev/containers-data/CCHet/Map/index.html create mode 100644 dev/containers-data/CCHet/Tbl/index.html diff --git a/dev/containers-data/CCHet/Key/index.html b/dev/containers-data/CCHet/Key/index.html new file mode 100644 index 00000000..8dcb7d68 --- /dev/null +++ b/dev/containers-data/CCHet/Key/index.html @@ -0,0 +1,2 @@ + +Key (containers-data.CCHet.Key)

Module CCHet.Key

Keys with a type witness.

type 'a t

A key of type 'a t is used to access the portion of the map or table that associates keys of type 'a to values.

val create : unit -> 'a t

Make a new key. This is generative, so calling create () twice with the same return type will produce incompatible keys that cannot see each other's bindings.

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 new file mode 100644 index 00000000..00f60a63 --- /dev/null +++ b/dev/containers-data/CCHet/Map/index.html @@ -0,0 +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 diff --git a/dev/containers-data/CCHet/Tbl/index.html b/dev/containers-data/CCHet/Tbl/index.html new file mode 100644 index 00000000..33600ffb --- /dev/null +++ b/dev/containers-data/CCHet/Tbl/index.html @@ -0,0 +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 clear : t -> unit

clear the table (like Hashtbl.clear)

  • since 3.11
val reset : t -> unit

reset the table (like Hashtbl.reset)

  • since 3.11
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/CCFun/Infix/index.html b/dev/containers/CCFun/Infix/index.html index 5dc22277..a1fc55eb 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.

val let@ : ('a -> 'b) -> 'a -> 'b

let@ x = foo in bar is the equivalent of foo @@ fun x -> bar. It can be very useful for resource management, alongside with protect.

  • since NEXT_RELEASE
\ 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.

val let@ : ('a -> 'b) -> 'a -> 'b

let@ x = foo in bar is the equivalent of foo @@ fun x -> bar. It can be very useful for resource management, alongside with protect.

  • since 3.11
\ No newline at end of file diff --git a/dev/containers/CCFun/index.html b/dev/containers/CCFun/index.html index d9ced7b7..29c580bc 100644 --- a/dev/containers/CCFun/index.html +++ b/dev/containers/CCFun/index.html @@ -1,4 +1,4 @@ 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) -> ('a -> 'a -> int) -> 'a -> 'a -> int

Lexicographic combination of comparison functions.

val finally : h:(unit -> _) -> f:(unit -> 'a) -> 'a

finally ~h f calls f () and returns its result. If it raises, the same exception is raised; in any case, h () is called after f () terminates. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.

val finally1 : h:(unit -> _) -> ('a -> 'b) -> 'a -> 'b

finally1 ~h f x is the same as f x, but after the computation, h () is called whether f x rose an exception or not. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.

  • since 0.16
val finally2 : h:(unit -> _) -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'c

finally2 ~h f x y is the same as f x y, but after the computation, h () is called whether f x y rose an exception or not. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.

  • since 0.16
val opaque_identity : 'a -> 'a

opaque_identity x is like x, but prevents Flambda from using x's definition for optimizing it. (flambda is an optimization/inlining pass in OCaml >= 4.03).

  • since 0.18
val iterate : int -> ('a -> 'a) -> 'a -> 'a

iterate n f is f iterated n times. That is to say, iterate 0 f x is x, iterate 1 f x is f x, iterate 2 f x is f (f x), etc.

  • since 2.1

Infix

Infix operators.

module Infix : sig ... end
include module type of 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.

val let@ : ('a -> 'b) -> 'a -> 'b

let@ x = foo in bar is the equivalent of foo @@ fun x -> bar. It can be very useful for resource management, alongside with protect.

  • since NEXT_RELEASE

Monad

Functions with a fixed domain are monads in their codomain.

module Monad (X : sig ... end) : sig ... end
\ No newline at end of file +|> tap @@ CCArray.sort Stdlib.compare
val lexicographic : ('a -> 'a -> int) -> ('a -> 'a -> int) -> 'a -> 'a -> int

Lexicographic combination of comparison functions.

val finally : h:(unit -> _) -> f:(unit -> 'a) -> 'a

finally ~h f calls f () and returns its result. If it raises, the same exception is raised; in any case, h () is called after f () terminates. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.

val finally1 : h:(unit -> _) -> ('a -> 'b) -> 'a -> 'b

finally1 ~h f x is the same as f x, but after the computation, h () is called whether f x rose an exception or not. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.

  • since 0.16
val finally2 : h:(unit -> _) -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'c

finally2 ~h f x y is the same as f x y, but after the computation, h () is called whether f x y rose an exception or not. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.

  • since 0.16
val opaque_identity : 'a -> 'a

opaque_identity x is like x, but prevents Flambda from using x's definition for optimizing it. (flambda is an optimization/inlining pass in OCaml >= 4.03).

  • since 0.18
val iterate : int -> ('a -> 'a) -> 'a -> 'a

iterate n f is f iterated n times. That is to say, iterate 0 f x is x, iterate 1 f x is f x, iterate 2 f x is f (f x), etc.

  • since 2.1

Infix

Infix operators.

module Infix : sig ... end
include module type of 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.

val let@ : ('a -> 'b) -> 'a -> 'b

let@ x = foo in bar is the equivalent of foo @@ fun x -> bar. It can be very useful for resource management, alongside with protect.

  • since 3.11

Monad

Functions with a fixed domain are monads in their codomain.

module Monad (X : sig ... end) : sig ... end
\ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 46cc4e1f..009e58e2 100644 --- a/dev/index.html +++ b/dev/index.html @@ -11,9 +11,9 @@

OCaml package documentation

    -
  1. containers 3.10
  2. -
  3. containers-data 3.10
  4. -
  5. containers-thread 3.10
  6. +
  7. containers 3.11
  8. +
  9. containers-data 3.11
  10. +
  11. containers-thread 3.11