Module Tpf_qcheck
Generic QCheck.arbitrary.
Note that if your type has interesting recursion, this will probably not work as it is not possible to fixpoint through arbitrary
.
Most of the work here is being done by Tpf_std.Random
and Tpf_fmt
, which you can use directly if this is the case.
val g_arb : ('a, p) Tpf.view -> ('a, p) Tpf.schema -> ?base:'a -> int -> 'a QCheck.arbitrary
g_arb view schema ~base size
is thearbitrary
instance over'a
.base
andsize
are used byTpf_std.Random.g_gen
to bound the recursion depth.
data
interface
include Tpf.Data with type 'a q := 'a QCheck.arbitrary and type 'a r := ?base:'a -> int -> 'a QCheck.arbitrary
type 'a r
The overall result type.
It's often the same as
q
, but it doesn't have to be.
val data0 : 'x Tpf.data0 -> 'x r
val data1 : ('a, 'x) Tpf.data1 -> 'a q -> 'x r
val data2 : ('a, 'b, 'x) Tpf.data2 -> 'a q -> 'b q -> 'x r
val data3 : ('a, 'b, 'c, 'x) Tpf.data3 -> 'a q -> 'b q -> 'c q -> 'x r
val data4 : ('a, 'b, 'c, 'd, 'x) Tpf.data4 -> 'a q -> 'b q -> 'c q -> 'd q -> 'x r
val data5 : ('a, 'b, 'c, 'd, 'e, 'x) Tpf.data5 -> 'a q -> 'b q -> 'c q -> 'd q -> 'e q -> 'x r
val data6 : ('a, 'b, 'c, 'd, 'e, 'f, 'x) Tpf.data6 -> 'a q -> 'b q -> 'c q -> 'd q -> 'e q -> 'f q -> 'x r
val data7 : ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'x) Tpf.data7 -> 'a q -> 'b q -> 'c q -> 'd q -> 'e q -> 'f q -> 'g q -> 'x r
val data8 : ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'x) Tpf.data8 -> 'a q -> 'b q -> 'c q -> 'd q -> 'e q -> 'f q -> 'g q -> 'h q -> 'x r
val data9 : ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'x) Tpf.data9 -> 'a q -> 'b q -> 'c q -> 'd q -> 'e q -> 'f q -> 'g q -> 'h q -> 'i q -> 'x r