package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a

doc/octez-libs.test-helpers/Tezos_test_helpers/Qcheck_extra/Stateful_gen/Make/index.html

Module Stateful_gen.MakeSource

Produces a pseudo-random generator that can execute side-effects in an underlying Monad.S.

Applied to Identity this is similar to QCheck.Gen.

This is a straight RNG without shrinking.

Parameters

module F : Monad.S

Signature

include Monad.S
include Applicative.S
include Functor.S
Sourcetype 'a t
Sourceval map : ('a -> 'b) -> 'a t -> 'b t

Map over the given value.

Sourceval return : 'a -> 'a t

Inject the given value.

Sourceval map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

Map a binary function over the given value.

Sourceval product : 'a t -> 'b t -> ('a * 'b) t

Combine the given values. See also map2.

Sourceval join : 'a t t -> 'a t

Monadic join operator.

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

Monadic bind operator.

Sourcetype 'a m = 'a F.t
Sourceval bool : bool t

Generate a bool.

Sourceval nat_less_than : int -> int t

Generate a nat smaller than the given value.

Sourceval small_int : int t

Generate a small int.

Sourceval replicate : int -> 'a t -> 'a list t

Generate a list of the given length.

Sourceval replicate_for_each : 'a list -> 'b t -> ('a * 'b) list t

Run a predetermined generator for each element in a list, and combine the result with the list element.

See traverse for a more general form.

Sourceval traverse : ('a -> 'b t) -> 'a list -> 'b list t

Produce a generator for each element in a list.

Sourceval oneof : 'a t Non_empty.t -> 'a t

Return a generator that picks and invokes one of the given generators, uniformly distributed.

Sourceval small_list : 'a t -> 'a list t

Generate a short list.

Sourceval opt : 'a t -> 'a option t

Generate an optional value.

Sourceval char_readable : char t

Generate a readable character.

Sourceval string_readable : string t

Generate a readable string.

Sourceval lift : 'a m -> 'a t

Lift the underlying computation type into a generator.

Sourceval to_qcheck_gen : 'a t -> 'a m QCheck.Gen.t

Convert a QCheck_extra generator to a QCheck generator.

The QCheck generator is run once once and the result is used as the seed of the given generator.

Warning Because Stdlib.Random.Gen and QCheck.Gen have mutable state, you must make sure this is only called once, to get predictable results.

OCaml

Innovation. Community. Security.