Skip to content

Commit

Permalink
Gen.fix has a more general and useful type
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche authored and c-cube committed Jun 21, 2019
1 parent 28f6426 commit 724e878
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core/QCheck.mli
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,14 @@ module Gen : sig
to the size-bounded generator.
@since 0.5 *)

val fix : ('a sized -> 'a sized) -> 'a sized
(** Fixpoint combinator for generating recursive, size-bounded data types.
val fix : (('a -> 'b t) -> ('a -> 'b t)) -> 'a -> 'b t
(** Parametrized fixpoint combinator for generating recursive values.
The fixpoint is parametrized over an arbitrary state ('a), and the
fixpoint computation may change the value of this state in the recursive
calls.
In particular, this can be used for size-bounded generators ('a is int).
The passed size-parameter should decrease to ensure termination. *)

(** Example:
Expand Down

0 comments on commit 724e878

Please sign in to comment.