Page
Library
Module
Module type
Parameter
Class
Class type
Source
This page lists every public signature that has a mode in OxCaml. Only concurrent state machines need modes.
A concurrent rule body is portable. Each combinator has a portable version, which you select with [@mode portable]:
let keys =
(map [@mode portable]) Key.of_int (integers ~min_value:0 ~max_value:99 ())The primitive generators (Hegel.integers, Hegel.text, ...) are already portable. [@@deriving hegel_generator ~portable] derives a portable generator:
type point =
{ x : int
; y : int
}
[@@deriving hegel_generator ~portable][@mode portable] requires ppx_template in the pps of the dune stanza that builds the code. ppx_template is included in ppx_jane, ppx_hegel_test or ppx_hegel_generator. Without it, OxCaml ignores the attribute and uses the nonportable version.
These modules declare @@ portable as their default: Hegel, Hegel.Generators, Hegel.Derive, Hegel.Settings, Hegel_jane, Hegel_jane_concurrent, and the Hegel.Stateful submodules Hegel.Stateful.Concurrent_pool, Hegel.Stateful.Rule, Hegel.Stateful.Invariant, and Hegel.Stateful.Concurrent_rule. The Hegel.Stateful runners (Hegel.Stateful.run, Hegel.Stateful.run_concurrent) are not portable.
type test_case : value mod portable contendedtype ('a, 'p) generator : value mod contendedval%template map
: ('a -> 'b) @ m
-> ('a, 'p) generator @ m
-> ('b, unprintable) generator @ m
[@@mode m = (nonportable, portable)]
val%template just : ('a : value mod c). 'a @ m -> ('a, unprintable) generator @ m
[@@mode (m, c) = ((nonportable, uncontended), (portable, contended))]
val%template sampled_from
: ('a : value mod c). 'a list @ m -> ('a, unprintable) generator @ m
[@@mode (m, c) = ((nonportable, uncontended), (portable, contended))]with_printer, printer, composite, flat_map, filter, one_of, optional, tuples2/tuples3/tuples4, lists, assoc_lists, hash_tables, make_hash_tables, make_characters, make_dates, make_times, make_datetimes, functions/functions2/functions3, and Hegel_jane.hash_tables use the same template as map.
The primitives return @ portable and have one version: Hegel.booleans, Hegel.integers, Hegel.floats, Hegel.text, Hegel.characters, Hegel.chars, Hegel.binary, Hegel.emails, Hegel.urls, Hegel.domains, Hegel.from_regex, Hegel.dates, Hegel.times, Hegel.datetimes, Hegel.ip_addresses, and the Hegel_jane generators other than Hegel_jane.hash_tables.
Hegel.Stateful.Concurrent_pool.t
type ('a : value mod portable contended) t : value mod portable contendedHegel.Stateful.Concurrent_pool.create
val create : ?clone:('a -> 'a) @ portable -> test_case -> 'a tHegel.Stateful.Concurrent_rule.t
type ('ctx, 'state) t : value mod portable contendedHegel.Stateful.Concurrent_rule.create
val create
: ?group:string
-> ?weight:float
-> name:string
-> step:(test_case -> 'ctx @ local -> 'state @ contended -> unit) @ portable
-> unit
-> ('ctx, 'state) tval run_concurrent
: concurrency:'ctx Concurrency.t @ local
-> ?min_concurrency:int
-> ?max_concurrency:int
-> ?step_count:int
-> ?sexp_of_state:('state -> Sexplib0.Sexp.t)
-> test_case
-> (module Concurrent_state_machine with type ctx = 'ctx and type state = 'state)
-> init:'state @ portable
-> unittype 'ctx t =
{ spawn_join_n :
n:int
-> (f:('ctx @ local -> int -> outcome) @ portable -> outcome list @ contended) @ local
}val of_concurrent : 'a Concurrent.t @ local -> 'a ctx Hegel.Concurrency.t @ local