From 40896cc803c108a5679a33c1130c390cd04fb63a Mon Sep 17 00:00:00 2001 From: c-cube Date: Sat, 19 Mar 2022 14:31:35 +0000 Subject: [PATCH] deploy: 173da383665e3cb8015e40e40c059d141fc9829a --- dev/iter/IterLabels/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/iter/IterLabels/index.html b/dev/iter/IterLabels/index.html index 6d92626..81d2679 100644 --- a/dev/iter/IterLabels/index.html +++ b/dev/iter/IterLabels/index.html @@ -47,7 +47,7 @@ 'a t

Convert the given set to an iterator. The set module must be provided.

val to_set : (module Stdlib.Set.S with type elt = 'a and type t = 'b) -> 'a t -> - 'b

Convert the iterator to a set, given the proper set module

type 'a gen = unit -> 'a option
val of_gen : 'a gen -> 'a t

Traverse eagerly the generator and build an iterator from it

val of_gen_once : 'a gen -> 'a t

One shot iterator using this generator. It must not be traversed twice.

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

Make the iterator persistent (O(n)) and then iterate on it. Eager.

Sets

module Set : sig ... end

Maps

module Map : sig ... end

Random iterators

val random_int : int -> int t

Infinite iterator of random integers between 0 and the given higher bound (see Random.int)

val random_bool : bool t

Infinite iterator of random bool values

val random_float : float -> float t
val random_array : 'a array -> 'a t

Iterator of choices of an element in the array

val random_list : 'a list -> 'a t

Infinite iterator of random elements of the list. Basically the same as random_array.

val shuffle : 'a t -> 'a t

shuffle seq returns a perfect shuffle of seq. Uses O(length seq) memory and time. Eager.

  • since 0.7
val shuffle_buffer : n:int -> 'a t -> 'a t

shuffle_buffer n seq returns an iterator of element of seq in random order. The shuffling is not uniform. Uses O(n) memory.

The first n elements of the iterator are consumed immediately. The rest is consumed lazily.

  • since 0.7

Sampling

val sample : n:int -> 'a t -> 'a array

sample n seq returns k samples of seq, with uniform probability. It will consume the iterator and use O(n) memory.

It returns an array of size min (length seq) n.

  • since 0.7

Infix functions

module Infix : sig ... end
include module type of Infix
val (--) : int -> int -> int t

a -- b is the range of integers from a to b, both included, in increasing order. It will therefore be empty if a > b.

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

a --^ b is the range of integers from b to a, both included, in decreasing order (starts from a). It will therefore be empty if a < b.

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

Monadic bind (infix version of flat_map

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

Infix version of map

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

Applicative operator (product+application)

  • since 0.5
val (<+>) : 'a t -> 'a t -> 'a t

Concatenation of iterators

  • since 0.5

Pretty printing

val pp_seq : + 'b

Convert the iterator to a set, given the proper set module

type 'a gen = unit -> 'a option
val of_gen : 'a gen -> 'a t

Traverse eagerly the generator and build an iterator from it

val to_gen : 'a t -> 'a gen

Make the iterator persistent (O(n)) and then iterate on it. Eager.

Sets

module Set : sig ... end

Maps

module Map : sig ... end

Random iterators

val random_int : int -> int t

Infinite iterator of random integers between 0 and the given higher bound (see Random.int)

val random_bool : bool t

Infinite iterator of random bool values

val random_float : float -> float t
val random_array : 'a array -> 'a t

Iterator of choices of an element in the array

val random_list : 'a list -> 'a t

Infinite iterator of random elements of the list. Basically the same as random_array.

val shuffle : 'a t -> 'a t

shuffle seq returns a perfect shuffle of seq. Uses O(length seq) memory and time. Eager.

  • since 0.7
val shuffle_buffer : n:int -> 'a t -> 'a t

shuffle_buffer n seq returns an iterator of element of seq in random order. The shuffling is not uniform. Uses O(n) memory.

The first n elements of the iterator are consumed immediately. The rest is consumed lazily.

  • since 0.7

Sampling

val sample : n:int -> 'a t -> 'a array

sample n seq returns k samples of seq, with uniform probability. It will consume the iterator and use O(n) memory.

It returns an array of size min (length seq) n.

  • since 0.7

Infix functions

module Infix : sig ... end
include module type of Infix
val (--) : int -> int -> int t

a -- b is the range of integers from a to b, both included, in increasing order. It will therefore be empty if a > b.

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

a --^ b is the range of integers from b to a, both included, in decreasing order (starts from a). It will therefore be empty if a < b.

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

Monadic bind (infix version of flat_map

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

Infix version of map

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

Applicative operator (product+application)

  • since 0.5
val (<+>) : 'a t -> 'a t -> 'a t

Concatenation of iterators

  • since 0.5

Pretty printing

val pp_seq : ?sep:string -> ( Stdlib.Format.formatter -> 'a -> unit ) -> Stdlib.Format.formatter ->