Module QCheck.Print

The Print module offers combinators for printing generated values.

type 'a t = 'a -> string

Printer for values of type 'a.

val unit : unit t
  • since 0.6
val int : int t

Integer printer.

val bool : bool t

Boolean printer.

val float : float t

Floating point number printer.

val char : char t

Character printer.

val bytes : bytes t

Bytes printer.

  • since 0.20
val string : string t

String printer.

val option : 'a t -> 'a option t

Option printer.

val pair : 'a t -> 'b t -> ('a * 'b) t

Pair printer. Expects printers for each component.

val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t

Triple (3-tuple) printer. Expects printers for each component.

val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t

Quadruple (4-tuple) printer. Expects printers for each component.

val list : 'a t -> 'a list t

List printer. Expects a printer for the list element type.

val array : 'a t -> 'a array t

Array printer. Expects a printer for the array entry type.

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

comap f p maps p, a printer of type 'b, to a printer of type 'a by first converting a printed value using f : 'a -> 'b.

val tup2 : 'a t -> 'b t -> ('a * 'b) t

2-tuple printer. Expects printers for each component.

val tup3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t

3-tuple printer. Expects printers for each component.

val tup4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t

4-tuple printer. Expects printers for each component.

val tup5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) t

5-tuple printer. Expects printers for each component.

val tup6 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> ('a * 'b * 'c * 'd * 'e * 'f) t

6-tuple printer. Expects printers for each component.

val tup7 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g) t

7-tuple printer. Expects printers for each component.

val tup8 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) t

8-tuple printer. Expects printers for each component.

val tup9 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> 'i t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i) t

9-tuple printer. Expects printers for each component.