diff --git a/CHANGELOG.md b/CHANGELOG.md index ce88fef0..636e816d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,21 @@ ## NEXT RELEASE (202?-??-??) -- ... +- Add ocamlmig `@@migrate` attributes to deprecated combinator names. + The following are missing a direct translation: + - `QCheck.Gen.big_nat` at most 1_000_000 without a direct translation in distribution + - `QCheck.Gen.neg_int` a non-uniform generator without a direct translation in distribution + - `QCheck.Gen.int_pos_corners` deprecated without a replacement + - `QCheck.Gen.int_corners` deprecated without a replacement + - `QCheck.Gen.shuffle_a` is in-place, whereas the replacement `QCheck.Gen.shuffle_array` isn't + - `QCheck.neg_int` a non-uniform generator without a direct translation in distribution + - `QCheck.small_int_corners` without a direct translation as `int_small_corners` is signed + - `QCheck2.Gen.big_nat` at most 1_000_000 without a direct translation in distribution + - `QCheck2.Gen.neg_int` a non-uniform generator without a direct translation in distribution + - `QCheck2.Gen.small_int_corners` without a direct translation as `int_small_corners` is signed + - `QCheck2.Gen.int_pos_corners` deprecated without a replacement + - `QCheck2.Gen.int_corners` deprecated without a replacement + ## 0.90 (2025-12-19) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 06c9295b..3c002b54 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -209,7 +209,7 @@ module Gen : sig @raise Invalid_argument or Failure if list is empty @since 0.90 *) - val oneofl : 'a list -> 'a t [@@deprecated "Use [oneof_list] instead"] + val oneofl : 'a list -> 'a t [@@deprecated "Use [oneof_list] instead"][@@migrate { repl = Rel.oneof_list }] (** Constructs a generator that selects among a given list of values. @raise Invalid_argument or Failure if list is empty @deprecated use {!oneof_list} instead. *) @@ -219,7 +219,7 @@ module Gen : sig @raise Invalid_argument or Failure if list is empty @since 0.90 *) - val oneofa : 'a array -> 'a t [@@deprecated "Use [oneof_array] instead"] + val oneofa : 'a array -> 'a t [@@deprecated "Use [oneof_array] instead"][@@migrate { repl = Rel.oneof_array }] (** Constructs a generator that selects among a given array of values. @raise Invalid_argument or Failure if list is empty @deprecated use {!oneof_array} instead. *) @@ -229,7 +229,7 @@ module Gen : sig Each of the given generators are chosen based on a positive integer weight. @since 0.90 *) - val frequency : (int * 'a t) list -> 'a t [@@deprecated "Use [oneof_weighted] instead"] + val frequency : (int * 'a t) list -> 'a t [@@deprecated "Use [oneof_weighted] instead"][@@migrate { repl = Rel.oneof_weighted }] (** Constructs a generator that selects among a given list of generators. Each of the given generators are chosen based on a positive integer weight. @deprecated use {!oneof_weighted} instead. *) @@ -239,7 +239,7 @@ module Gen : sig Each of the given values are chosen based on a positive integer weight. @since 0.90 *) - val frequencyl : (int * 'a) list -> 'a t [@@deprecated "Use [oneof_list_weighted] instead"] + val frequencyl : (int * 'a) list -> 'a t [@@deprecated "Use [oneof_list_weighted] instead"][@@migrate { repl = Rel.oneof_list_weighted }] (** Constructs a generator that selects among a given list of values. Each of the given values are chosen based on a positive integer weight. @deprecated use {!oneof_list_weighted} instead. *) @@ -249,7 +249,7 @@ module Gen : sig Each of the array entries are chosen based on a positive integer weight. @since 0.90 *) - val frequencya : (int * 'a) array -> 'a t [@@deprecated "Use [oneof_array_weighted] instead"] + val frequencya : (int * 'a) array -> 'a t [@@deprecated "Use [oneof_array_weighted] instead"][@@migrate { repl = Rel.oneof_array_weighted }] (** Constructs a generator that selects among a given array of values. Each of the array entries are chosen based on a positive integer weight. @deprecated use {!oneof_array_weighted} instead. *) @@ -258,15 +258,15 @@ module Gen : sig (** Creates a generator of shuffled arrays. @since 0.90 *) - val shuffle_a : 'a array -> unit t [@@deprecated "Use [shuffle_array] instead"] + val shuffle_a : 'a array -> unit t [@@deprecated "Consider using [shuffle_array] instead"] (** Shuffles the array in place. - @deprecated Use {!shuffle_array} instead. *) + @deprecated Consider using {!shuffle_array} instead. *) val shuffle_list : 'a list -> 'a list t (** Creates a generator of shuffled lists. @since 0.90 *) - val shuffle_l : 'a list -> 'a list t [@@deprecated "Use [shuffle_list] instead"] + val shuffle_l : 'a list -> 'a list t [@@deprecated "Use [shuffle_list] instead"][@@migrate { repl = Rel.shuffle_list }] (** Creates a generator of shuffled lists. @deprecated Use {!shuffle_list} instead. *) @@ -283,7 +283,7 @@ module Gen : sig @since 0.90 *) - val shuffle_w_l : (int * 'a) list -> 'a list t [@@deprecated "Use [shuffle_list_weighted] instead"] + val shuffle_w_l : (int * 'a) list -> 'a list t [@@deprecated "Use [shuffle_list_weighted] instead"][@@migrate { repl = Rel.shuffle_list_weighted }] (** An alias for {!shuffle_list_weighted} since 0.90. @since 0.11 @deprecated use {!shuffle_list_weighted} instead. *) @@ -324,11 +324,11 @@ module Gen : sig val float_neg : float t (** Generates negative floating point numbers (-0. included). *) - val pfloat : float t [@@deprecated "Use [float_pos] instead"] + val pfloat : float t [@@deprecated "Use [float_pos] instead"][@@migrate { repl = Rel.float_pos }] (** Generates positive floating point numbers (0. included). @deprecated use {!float_pos} instead. *) - val nfloat : float t [@@deprecated "Use [float_neg] instead"] + val nfloat : float t [@@deprecated "Use [float_neg] instead"][@@migrate { repl = Rel.float_neg }] (** Generates negative floating point numbers (-0. included). @deprecated use {!float_neg} instead. *) @@ -388,7 +388,7 @@ module Gen : sig (** Generates non-strictly positive integers uniformly (0 included). @since 0.90 *) - val pint : int t [@@deprecated "Use [int_pos] instead"] + val pint : int t [@@deprecated "Use [int_pos] instead"][@@migrate { repl = Rel.int_pos }] (** Generates non-strictly positive integers uniformly (0 included). @deprecated use {!int_pos} instead. *) @@ -407,16 +407,16 @@ module Gen : sig Synonym for {!int_pos_small}. @since 0.90 *) - val small_nat : int t [@@deprecated "Use [nat_small] instead"] + val small_nat : int t [@@deprecated "Use [nat_small] instead"][@@migrate { repl = Rel.nat_small }] (** Small integers (< 100) @since 0.5.1 @deprecated use {!nat_small} instead *) - val small_int : int t [@@deprecated "Use [nat_small] instead"] + val small_int : int t [@@deprecated "Use [nat_small] instead"][@@migrate { repl = Rel.nat_small }] (** Small UNSIGNED integers, for retrocompatibility. @deprecated use {!nat_small}. *) - val small_signed_int : int t [@@deprecated "Use [int_small] instead"] + val small_signed_int : int t [@@deprecated "Use [int_small] instead"][@@migrate { repl = Rel.int_small }] (** Small SIGNED integers, based on {!small_nat}. @since 0.5.2 @deprecated use {!int_small} instead. *) @@ -471,12 +471,12 @@ module Gen : sig (** Generates [int64] values uniformly. @since 0.24 *) - val ui32 : int32 t [@@deprecated "Use [int32] instead"] + val ui32 : int32 t [@@deprecated "Use [int32] instead"][@@migrate { repl = Rel.int32 }] (** Generates [int32] values. @deprecated use {!val:int32} instead, the name is wrong, values {i are} signed. *) - val ui64 : int64 t [@@deprecated "Use [int64] instead"] + val ui64 : int64 t [@@deprecated "Use [int64] instead"][@@migrate { repl = Rel.int64 }] (** Generates [int64] values. @deprecated use {!val:int64} instead, the name is wrong, values {i are} signed. *) @@ -487,7 +487,7 @@ module Gen : sig val list_size : int t -> 'a t -> 'a list t (** Builds a list generator from a (non-negative) size generator and an element generator. *) - val list_repeat : int -> 'a t -> 'a list t [@@deprecated "Use [list_size (return i) g] instead"] + val list_repeat : int -> 'a t -> 'a list t [@@deprecated "Use [list_size (return i) g] instead"][@@migrate { repl = (fun i g -> Rel.list_size (Rel.return i) g) }] (** [list_repeat i g] builds a list generator from exactly [i] elements generated by [g]. @deprecated use [list_size (return i) g] instead. *) @@ -497,7 +497,7 @@ module Gen : sig val array_size : int t -> 'a t -> 'a array t (** Builds an array generator from a (non-negative) size generator and an element generator. *) - val array_repeat : int -> 'a t -> 'a array t [@@deprecated "Use [array_size (return i) g] instead"] + val array_repeat : int -> 'a t -> 'a array t [@@deprecated "Use [array_size (return i) g] instead"][@@migrate { repl = (fun i g -> Rel.array_size (Rel.return i) g) }] (** [array_repeat i g] builds an array generator from exactly [i] elements generated by [g]. @deprecated use [array_size (return i) g] instead. *) @@ -509,7 +509,7 @@ module Gen : sig @since 0.19 (renamed from [opt]) *) - val opt : ?ratio:float -> 'a t -> 'a option t [@@deprecated "Use [option] instead"] + val opt : ?ratio:float -> 'a t -> 'a option t [@@deprecated "Use [option] instead"][@@migrate { repl = Rel.option }] (** [opt] is an alias of {!val:option} for backward compatibility. @since 0.18 ([?ratio] parameter) @@ -600,7 +600,7 @@ module Gen : sig (** Builds a string generator using the given character generator. @since 0.11 *) - val string_readable : string t [@@deprecated "Use [string_printable] instead"] + val string_readable : string t [@@deprecated "Use [string_printable] instead"][@@migrate { repl = Rel.string_printable }] (** Builds a string generator using the {!printable} character generator. @since 0.11 @deprecated use {!string_printable} *) @@ -609,7 +609,7 @@ module Gen : sig (** Builds a string generator using the {!printable} character generator. @since 0.18 *) - val small_string : ?gen:char t -> string t [@@deprecated "Use [string_small] instead"] + val small_string : ?gen:char t -> string t [@@deprecated "Use [string_small] instead"][@@migrate { repl = Rel.string_small }] (** Builds a string generator, length is {!nat_small} Accepts an optional character generator (the default is {!char}). @deprecated use {!string_small} *) @@ -626,7 +626,7 @@ module Gen : sig (** Generates lists of small size (see {!nat_small}). @since 0.90 *) - val small_list : 'a t -> 'a list t [@@deprecated "Use [list_small] instead"] + val small_list : 'a t -> 'a list t [@@deprecated "Use [list_small] instead"][@@migrate { repl = Rel.list_small }] (** Generates lists of small size (see {!nat_small}). @since 0.5.3 @deprecated use {!list_small} instead. *) @@ -635,7 +635,7 @@ module Gen : sig (** Generate a list of elements from individual generators @since 0.90 *) - val flatten_l : 'a t list -> 'a list t [@@deprecated "Use [flatten_list] instead"] + val flatten_l : 'a t list -> 'a list t [@@deprecated "Use [flatten_list] instead"][@@migrate { repl = Rel.flatten_list }] (** Generate a list of elements from individual generators @since 0.13 @deprecated use {!flatten_list} instead. *) @@ -644,7 +644,7 @@ module Gen : sig (** Generate an array of elements from individual generators @since 0.90 *) - val flatten_a : 'a t array -> 'a array t [@@deprecated "Use [flatten_array] instead"] + val flatten_a : 'a t array -> 'a array t [@@deprecated "Use [flatten_array] instead"][@@migrate { repl = Rel.flatten_array }] (** Generate an array of elements from individual generators @since 0.13 @deprecated use {!flatten_array} instead. *) @@ -653,7 +653,7 @@ module Gen : sig (** Generate an option from an optional generator @since 0.90 *) - val flatten_opt : 'a t option -> 'a option t [@@deprecated "Use [flatten_option] instead"] + val flatten_opt : 'a t option -> 'a option t [@@deprecated "Use [flatten_option] instead"][@@migrate { repl = Rel.flatten_option }] (** Generate an option from an optional generator @since 0.13 @deprecated use {!flatten_option} instead. *) @@ -662,7 +662,7 @@ module Gen : sig (** Generate a result from [Ok g], an error from [Error e] @since 0.90 *) - val flatten_res : ('a t, 'e) result -> ('a,'e) result t [@@deprecated "Use [flatten_result] instead"] + val flatten_res : ('a t, 'e) result -> ('a,'e) result t [@@deprecated "Use [flatten_result] instead"][@@migrate { repl = Rel.flatten_result }] (** Generate a result from [Ok g], an error from [Error e] @since 0.13 @deprecated use {!flatten_result} instead. *) @@ -671,7 +671,7 @@ module Gen : sig (** Generates arrays of small size (see {!nat_small}). @since 0.90 *) - val small_array : 'a t -> 'a array t [@@deprecated "Use [array_small] instead"] + val small_array : 'a t -> 'a array t [@@deprecated "Use [array_small] instead"][@@migrate { repl = Rel.array_small }] (** Generates arrays of small size (see {!nat_small}). @since 0.10 @deprecated use {!array_small} instead. *) @@ -1298,11 +1298,11 @@ val float_pos : float arbitrary val float_neg : float arbitrary (** Negative float generator (no infinities). *) -val pos_float : float arbitrary [@@deprecated "Use [float_pos] instead"] +val pos_float : float arbitrary [@@deprecated "Use [float_pos] instead"][@@migrate { repl = Rel.float_pos }] (** Positive float generator (no infinities). @deprecated use {!float_pos} instead. *) -val neg_float : float arbitrary [@@deprecated "Use [float_neg] instead"] +val neg_float : float arbitrary [@@deprecated "Use [float_neg] instead"][@@migrate { repl = Rel.float_neg }] (** Negative float generator (no infinities). @deprecated use {!float_neg} instead. *) @@ -1369,16 +1369,16 @@ val nat_small : int arbitrary Synonym for {!int_pos_small}. @since 0.90 *) -val small_nat : int arbitrary [@@deprecated "Use [nat_small] instead"] +val small_nat : int arbitrary [@@deprecated "Use [nat_small] instead"][@@migrate { repl = Rel.nat_small }] (** Small unsigned integers. @since 0.5.1 @deprecated use {!nat_small} instead *) -val small_int : int arbitrary [@@deprecated "Use [nat_small] instead"] +val small_int : int arbitrary [@@deprecated "Use [nat_small] instead"][@@migrate { repl = Rel.nat_small }] (** Small unsigned integers. See {!Gen.small_int}. @deprecated use {!nat_small} instead *) -val small_signed_int : int arbitrary [@@deprecated "Use [int_small] instead"] +val small_signed_int : int arbitrary [@@deprecated "Use [int_small] instead"][@@migrate { repl = Rel.int_small }] (** Small signed integers. @since 0.5.2 @deprecated use {!int_small} instead *) @@ -1396,7 +1396,7 @@ val int_pos : int arbitrary (** Positive int generator (0 included). Uniformly distributed. See {!Gen.int_pos} *) -val pos_int : int arbitrary [@@deprecated "Use [int_pos] instead"] +val pos_int : int arbitrary [@@deprecated "Use [int_pos] instead"][@@migrate { repl = Rel.int_pos }] (** Positive int generator (0 included). Uniformly distributed. See {!Gen.int_pos} @deprecated use {!int_pos} instead. *) @@ -1460,7 +1460,7 @@ val printable : char arbitrary (** Synonym for {!char_printable}. @since 0.90 *) -val printable_char : char arbitrary [@@deprecated "Use [char_printable] instead"] +val printable_char : char arbitrary [@@deprecated "Use [char_printable] instead"][@@migrate { repl = Rel.char_printable }] (** Synonym for {!char_printable}. @deprecated use {!char_printable} instead. *) @@ -1472,7 +1472,7 @@ val numeral : char arbitrary (** Synonym for {!char_numeral}. @since 0.90 *) -val numeral_char : char arbitrary [@@deprecated "Use [char_numeral] instead"] +val numeral_char : char arbitrary [@@deprecated "Use [char_numeral] instead"][@@migrate { repl = Rel.char_numeral }] (** Synonym for {!char_numeral}. @deprecated use {!char_numeral} instead. *) @@ -1486,7 +1486,7 @@ val bytes_size_of : int Gen.t -> char Gen.t -> bytes arbitrary and a character generator. @since 0.90 *) -val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary [@@deprecated "Use [bytes_size] instead"] +val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary [@@deprecated "Use [bytes_size] instead"][@@migrate { repl = (fun s gen -> Rel.bytes_size ~gen s) }] (** Builds a bytes generator from a (non-negative) size generator and a character generator. @since 0.20 @deprecated use {!bytes_size} instead. *) @@ -1508,7 +1508,7 @@ val bytes_small_of : char Gen.t -> bytes arbitrary (** Same as {!bytes_of} but with a small length (ie {!Gen.nat_small} ). @since 0.20 *) -val bytes_of_size : int Gen.t -> bytes arbitrary [@@deprecated "Use [bytes_size] instead"] +val bytes_of_size : int Gen.t -> bytes arbitrary [@@deprecated "Use [bytes_size] instead"][@@migrate { repl = Rel.bytes_size }] (** Generates bytes with distribution of characters of [char]. @since 0.20 @deprecated use {!bytes_size} instead. *) @@ -1518,11 +1518,11 @@ val bytes_printable : bytes arbitrary and distribution of characters of [printable_char]. @since 0.20 *) -val string_gen_of_size : int Gen.t -> char Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"] +val string_gen_of_size : int Gen.t -> char Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"][@@migrate { repl = Rel.string_size_of }] (** Builds a string generator from a (non-negative) size generator and a character generator. @deprecated use {!string_size_of} instead. *) -val string_gen : char Gen.t -> string arbitrary [@@deprecated "Use [string_of] instead"] +val string_gen : char Gen.t -> string arbitrary [@@deprecated "Use [string_of] instead"][@@migrate { repl = Rel.string_of }] (** Generates strings with a distribution of length of {!Gen.nat}. @deprecated use {!string_of} instead. *) @@ -1544,7 +1544,7 @@ val string_size_of : int Gen.t -> char Gen.t -> string arbitrary and a character generator. @since 0.90 *) -val small_string : string arbitrary [@@deprecated "Use [string_small] instead"] +val small_string : string arbitrary [@@deprecated "Use [string_small] instead"][@@migrate { repl = Rel.string_small }] (** Same as {!string} but with a small length (ie {!Gen.nat_small} ). @deprecated use {!string_small} *) @@ -1560,16 +1560,16 @@ val list_small : 'a arbitrary -> 'a list arbitrary (** Generates lists of small size (see {!Gen.nat_small}). @since 0.90 *) -val small_list : 'a arbitrary -> 'a list arbitrary [@@deprecated "Use [list_small] instead"] +val small_list : 'a arbitrary -> 'a list arbitrary [@@deprecated "Use [list_small] instead"][@@migrate { repl = Rel.list_small }] (** Generates lists of small size (see {!Gen.nat_small}). @since 0.5.3 @deprecated use {!list_small} instead. *) -val string_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size] instead"] +val string_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size] instead"][@@migrate { repl = Rel.string_size }] (** Generates strings with distribution of characters of [char]. @deprecated use {!string_size} instead. *) -val printable_string : string arbitrary [@@deprecated "Use [string_printable] instead"] +val printable_string : string arbitrary [@@deprecated "Use [string_printable] instead"][@@migrate { repl = Rel.string_printable }] (** Generates strings with a distribution of length of {!Gen.nat} and distribution of characters of [char_printable]. @deprecated use {!string_printable} instead. *) @@ -1579,40 +1579,40 @@ val string_printable : string arbitrary and distribution of characters of [char_printable]. @since 0.20 *) -val printable_string_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"] +val printable_string_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"][@@migrate { repl = (fun s -> Rel.string_size_of s Rel.Gen.char_printable) }] (** Generates strings with distribution of characters of [char_printable]. @deprecated use {!string_size_of} instead. *) -val string_printable_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"] +val string_printable_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"][@@migrate { repl = (fun s -> Rel.string_size_of s Rel.Gen.char_printable) }] (** Synonym for [printable_string_of_size] added for convenience. @since 0.20 @deprecated use {!string_size_of} instead. *) -val small_printable_string : string arbitrary [@@deprecated "Use [string_size_of] instead"] +val small_printable_string : string arbitrary [@@deprecated "Use [string_size_of] instead"][@@migrate { repl = Rel.string_size_of Rel.Gen.nat_small Rel.Gen.char_printable }] (** Generates strings with a length of [Gen.nat_small] and distribution of characters of [char_printable]. @deprecated use {!string_size_of} instead. *) -val string_small_printable : string arbitrary [@@deprecated "Use [string_size_of] instead"] +val string_small_printable : string arbitrary [@@deprecated "Use [string_size_of] instead"][@@migrate { repl = Rel.string_size_of Rel.Gen.nat_small Rel.Gen.char_printable }] (** Synonym for [small_printable_string] added for convenience. @since 0.20 @deprecated use {!string_size_of} instead. *) -val numeral_string : string arbitrary [@@deprecated "Use [string_of] instead"] +val numeral_string : string arbitrary [@@deprecated "Use [string_of] instead"][@@migrate { repl = Rel.string_of Rel.Gen.char_numeral }] (** Generates strings with a distribution of length of {!Gen.nat} and distribution of characters of [char_numeral]. @deprecated use {!string_of} instead. *) -val string_numeral : string arbitrary [@@deprecated "Use [string_of] instead"] +val string_numeral : string arbitrary [@@deprecated "Use [string_of] instead"][@@migrate { repl = Rel.string_of Rel.Gen.char_numeral }] (** Synonym for [numeral_string] added for convenience. @since 0.20 @deprecated use {!string_of} instead. *) -val numeral_string_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"] +val numeral_string_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"][@@migrate { repl = (fun s -> Rel.string_size_of s Rel.Gen.char_numeral) }] (** Generates strings with a distribution of characters of [char_numeral]. @deprecated use {!string_size_of} instead. *) -val string_numeral_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"] +val string_numeral_of_size : int Gen.t -> string arbitrary [@@deprecated "Use [string_size_of] instead"][@@migrate { repl = (fun s -> Rel.string_size_of s Rel.Gen.char_numeral) }] (** Synonym for [numeral_string_of_size] added for convenience. @since 0.20 @deprecated use {!string_size_of} instead. *) @@ -1624,7 +1624,7 @@ val list_size : int Gen.t -> 'a arbitrary -> 'a list arbitrary (** Generates lists with length from the given distribution. @since 0.90 *) -val list_of_size : int Gen.t -> 'a arbitrary -> 'a list arbitrary [@@deprecated "Use [list_size] instead"] +val list_of_size : int Gen.t -> 'a arbitrary -> 'a list arbitrary [@@deprecated "Use [list_size] instead"][@@migrate { repl = Rel.list_size }] (** Generates lists with length from the given distribution. @deprecated use {!list_size} instead. *) @@ -1639,7 +1639,7 @@ val array_size : int Gen.t -> 'a arbitrary -> 'a array arbitrary (** Generates arrays with length from the given distribution. @since 0.90 *) -val array_of_size : int Gen.t -> 'a arbitrary -> 'a array arbitrary [@@deprecated "Use [array_size] instead"] +val array_of_size : int Gen.t -> 'a arbitrary -> 'a array arbitrary [@@deprecated "Use [array_size] instead"][@@migrate { repl = Rel.array_size }] (** Generates arrays with length from the given distribution. @deprecated use {!array_size} instead. *) @@ -1765,7 +1765,7 @@ val tup9 : (** {2 Combinatoric arbitrary combinators } *) -val choose : 'a arbitrary list -> 'a arbitrary [@@deprecated "Use [oneof] instead"] +val choose : 'a arbitrary list -> 'a arbitrary [@@deprecated "Use [oneof] instead"][@@migrate { repl = Rel.oneof }] (** Choose among the given list of generators. The list must not be empty; if it is [Invalid_argument] is raised. @deprecated use {!oneof} instead. *) @@ -1775,7 +1775,7 @@ val oneof_list : ?print:'a Print.t -> ?small:('a -> int) -> 'a list -> 'a arbitr @since 0.90 *) val oneofl : ?print:'a Print.t -> ?collect:('a -> string) -> - 'a list -> 'a arbitrary [@@deprecated "Use [oneof_list] instead"] + 'a list -> 'a arbitrary [@@deprecated "Use [oneof_list] instead"][@@migrate { repl = Rel.oneof_list }] (** Pick an element randomly in the list. @deprecated use {!oneof_list} instead. *) @@ -1784,7 +1784,7 @@ val oneof_array : ?print:'a Print.t -> ?small:('a -> int) -> 'a array -> 'a arbi @since 0.90 *) val oneofa : ?print:'a Print.t -> ?collect:('a -> string) -> - 'a array -> 'a arbitrary [@@deprecated "Use [oneof_array] instead"] + 'a array -> 'a arbitrary [@@deprecated "Use [oneof_array] instead"][@@migrate { repl = Rel.oneof_array }] (** Pick an element randomly in the array. @deprecated use {!oneof_array} instead. *) @@ -1810,7 +1810,7 @@ val oneof_weighted : ?print:'a Print.t -> ?small:('a -> int) -> val frequency : ?print:'a Print.t -> ?small:('a -> int) -> ?shrink:'a Shrink.t -> ?collect:('a -> string) -> - (int * 'a arbitrary) list -> 'a arbitrary [@@deprecated "Use [oneof_weighted] instead"] + (int * 'a arbitrary) list -> 'a arbitrary [@@deprecated "Use [oneof_weighted] instead"][@@migrate { repl = Rel.oneof_weighted }] (** Similar to {!oneof} but with frequencies. @deprecated use {!oneof_weighted} instead. *) @@ -1821,7 +1821,7 @@ val oneof_list_weighted : ?print:'a Print.t -> ?small:('a -> int) -> @since 0.90 *) val frequencyl : ?print:'a Print.t -> ?small:('a -> int) -> - (int * 'a) list -> 'a arbitrary [@@deprecated "Use [oneof_list_weighted] instead"] + (int * 'a) list -> 'a arbitrary [@@deprecated "Use [oneof_list_weighted] instead"][@@migrate { repl = Rel.oneof_list_weighted }] (** Same as {!oneof_list}, but each element is paired with its frequency in the probability distribution (the higher, the more likely). @deprecated use {!oneof_list_weighted} instead. *) @@ -1832,7 +1832,7 @@ val oneof_array_weighted : ?print:'a Print.t -> ?small:('a -> int) -> @since 0.90 *) val frequencya : ?print:'a Print.t -> ?small:('a -> int) -> - (int * 'a) array -> 'a arbitrary [@@deprecated "Use [oneof_array_weighted] instead"] + (int * 'a) array -> 'a arbitrary [@@deprecated "Use [oneof_array_weighted] instead"][@@migrate { repl = Rel.oneof_array_weighted }] (** Same as {!oneof_list_weighted}, but with an array. @deprecated use {!oneof_array_weighted} instead. *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 0d1d9eb9..fcff9f04 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -192,7 +192,7 @@ module Gen : sig @since 0.90 *) - val pint : ?origin : int -> int t [@@deprecated "Use [int_pos] instead"] + val pint : ?origin : int -> int t [@@deprecated "Use [int_pos] instead"][@@migrate { repl = Rel.int_pos }] (** Generates non-strictly positive integers uniformly ([0] included). Shrinks towards [origin] if specified, otherwise towards [0]. @@ -215,7 +215,7 @@ module Gen : sig @since 0.90 *) - val small_nat : int t [@@deprecated "Use [nat_small] instead"] + val small_nat : int t [@@deprecated "Use [nat_small] instead"][@@migrate { repl = Rel.nat_small }] (** Small positive integers (< [100], [0] included). Non-uniform: smaller numbers are more likely than bigger numbers. @@ -268,14 +268,14 @@ module Gen : sig @deprecated use {!int_neg} or [map (fun i -> -i) nat] instead. *) - val small_int : int t [@@deprecated "Use [nat_small] instead"] + val small_int : int t [@@deprecated "Use [nat_small] instead"][@@migrate { repl = Rel.nat_small }] (** Small UNSIGNED integers, for retrocompatibility. Shrinks towards [0]. @deprecated use {!nat_small}. *) - val small_signed_int : int t [@@deprecated "Use [int_small] instead"] + val small_signed_int : int t [@@deprecated "Use [int_small] instead"][@@migrate { repl = Rel.int_small }] (** Small SIGNED integers, based on {!small_nat}. Non-uniform: smaller numbers (in absolute value) are more likely than bigger numbers. @@ -324,7 +324,7 @@ module Gen : sig Shrinks towards [0l]. *) - val ui32 : int32 t [@@deprecated "Use [int32] instead"] + val ui32 : int32 t [@@deprecated "Use [int32] instead"][@@migrate { repl = Rel.int32 }] (** Generates {!int32} values. Shrinks towards [0l]. @@ -338,7 +338,7 @@ module Gen : sig Shrinks towards [0L]. *) - val ui64 : int64 t [@@deprecated "Use [int64] instead"] + val ui64 : int64 t [@@deprecated "Use [int64] instead"][@@migrate { repl = Rel.int64 }] (** Generates {!int64} values. Shrinks towards [0L]. @@ -364,7 +364,7 @@ module Gen : sig Shrinks towards [-0.]. *) - val pfloat : float t [@@deprecated "Use [float_pos] instead"] + val pfloat : float t [@@deprecated "Use [float_pos] instead"][@@migrate { repl = Rel.float_pos }] (** Generates positive floating point numbers ([0.] included). Shrinks towards [0.]. @@ -372,7 +372,7 @@ module Gen : sig @deprecated use {!float_pos} instead. *) - val nfloat : float t [@@deprecated "Use [float_neg] instead"] + val nfloat : float t [@@deprecated "Use [float_neg] instead"][@@migrate { repl = Rel.float_neg }] (** Generates negative floating point numbers. ([-0.] included). Shrinks towards [-0.]. @@ -520,7 +520,7 @@ module Gen : sig @since 0.20 *) - val small_string : ?gen:char t -> string t [@@deprecated "Use [string_small] instead"] + val small_string : ?gen:char t -> string t [@@deprecated "Use [string_small] instead"][@@migrate { repl = Rel.string_small }] (** Builds a string generator, length is {!nat_small}. Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. @@ -692,7 +692,7 @@ module Gen : sig @since 0.90 *) - val oneofl : 'a list -> 'a t [@@deprecated "Use [oneof_list] instead"] + val oneofl : 'a list -> 'a t [@@deprecated "Use [oneof_list] instead"][@@migrate { repl = Rel.oneof_list }] (** [oneofl l] constructs a generator that selects among the given list of values [l]. Shrinks towards the first element of the list. @@ -708,7 +708,7 @@ module Gen : sig @since 0.90 *) - val oneofa : 'a array -> 'a t [@@deprecated "Use [oneof_array] instead"] + val oneofa : 'a array -> 'a t [@@deprecated "Use [oneof_array] instead"][@@migrate { repl = Rel.oneof_array }] (** [oneofa a] constructs a generator that selects among the given array of values [a]. Shrinks towards the first element of the array. @@ -724,7 +724,7 @@ module Gen : sig @since 0.90 *) - val frequency : (int * 'a t) list -> 'a t [@@deprecated "Use [oneof_weighted] instead"] + val frequency : (int * 'a t) list -> 'a t [@@deprecated "Use [oneof_weighted] instead"][@@migrate { repl = Rel.oneof_weighted }] (** Constructs a generator that selects among a given list of generators. Each of the given generators are chosen based on a positive integer weight. @@ -740,7 +740,7 @@ module Gen : sig @since 0.90 *) - val frequencyl : (int * 'a) list -> 'a t [@@deprecated "Use [oneof_list_weighted] instead"] + val frequencyl : (int * 'a) list -> 'a t [@@deprecated "Use [oneof_list_weighted] instead"][@@migrate { repl = Rel.oneof_list_weighted }] (** Constructs a generator that selects among a given list of values. Each of the given values are chosen based on a positive integer weight. @@ -756,7 +756,7 @@ module Gen : sig @since 0.90 *) - val frequencya : (int * 'a) array -> 'a t [@@deprecated "Use [oneof_array_weighted] instead"] + val frequencya : (int * 'a) array -> 'a t [@@deprecated "Use [oneof_array_weighted] instead"][@@migrate { repl = Rel.oneof_array_weighted }] (** Constructs a generator that selects among a given array of values. Each of the array entries are chosen based on a positive integer weight. @@ -770,7 +770,7 @@ module Gen : sig (** Returns a copy of the array with its elements shuffled. @since 0.90 *) - val shuffle_a : 'a array -> 'a array t [@@deprecated "Use [shuffle_array] instead"] + val shuffle_a : 'a array -> 'a array t [@@deprecated "Use [shuffle_array] instead"][@@migrate { repl = Rel.shuffle_array }] (** Returns a copy of the array with its elements shuffled. @deprecated use {!shuffle_array} instead. *) @@ -778,7 +778,7 @@ module Gen : sig (** Creates a generator of shuffled lists. @since 0.90 *) - val shuffle_l : 'a list -> 'a list t [@@deprecated "Use [shuffle_list] instead"] + val shuffle_l : 'a list -> 'a list t [@@deprecated "Use [shuffle_list] instead"][@@migrate { repl = Rel.shuffle_list }] (** Creates a generator of shuffled lists. @deprecated use {!shuffle_list} instead. *) @@ -795,7 +795,7 @@ module Gen : sig @since 0.90 *) - val shuffle_w_l : (int * 'a) list -> 'a list t [@@deprecated "Use [shuffle_list_weighted] instead"] + val shuffle_w_l : (int * 'a) list -> 'a list t [@@deprecated "Use [shuffle_list_weighted] instead"][@@migrate { repl = Rel.shuffle_list_weighted }] (** A synonym for {!shuffle_list_weighted} since 0.90 @since 0.11 @deprecated use {!shuffle_list_weighted} instead. *) @@ -843,7 +843,7 @@ module Gen : sig @since 0.90 *) - val small_list : 'a t -> 'a list t [@@deprecated "Use [list_small] instead"] + val small_list : 'a t -> 'a list t [@@deprecated "Use [list_small] instead"][@@migrate { repl = Rel.list_small }] (** Generates lists of small size (see {!nat_small}). Shrinks on the number of elements first, then on elements. @@ -858,7 +858,7 @@ module Gen : sig Shrinks on the number of elements first, then on elements. *) - val list_repeat : int -> 'a t -> 'a list t [@@deprecated "Use [list_size (return i) g] instead"] + val list_repeat : int -> 'a t -> 'a list t [@@deprecated "Use [list_size (return i) g] instead"][@@migrate { repl = (fun i g -> Rel.list_size (Rel.return i) g) }] (** [list_repeat i g] builds a list generator from exactly [i] elements generated by [g]. Shrinks on elements only. @@ -884,7 +884,7 @@ module Gen : sig @since 0.90 *) - val small_array : 'a t -> 'a array t [@@deprecated "Use [array_small] instead"] + val small_array : 'a t -> 'a array t [@@deprecated "Use [array_small] instead"][@@migrate { repl = Rel.array_small }] (** Generates arrays of small size (see {!nat_small}). Shrinks on the number of elements first, then on elements. @@ -893,7 +893,7 @@ module Gen : sig @deprecated use {!array_small} instead. *) - val array_repeat : int -> 'a t -> 'a array t [@@deprecated "Use [array_size (return i) g] instead"] + val array_repeat : int -> 'a t -> 'a array t [@@deprecated "Use [array_size (return i) g] instead"][@@migrate { repl = (fun i g -> Rel.array_size (Rel.return i) g) }] (** [array_repeat i g] builds an array generator from exactly [i] elements generated by [g]. Shrinks on elements only. @@ -911,7 +911,7 @@ module Gen : sig @since 0.19 (renamed from [opt]) *) - val opt : ?ratio:float -> 'a t -> 'a option t [@@deprecated "Use [option] instead"] + val opt : ?ratio:float -> 'a t -> 'a option t [@@deprecated "Use [option] instead"][@@migrate { repl = Rel.option }] (** [opt] is an alias of {!val:option} for backward compatibility. @deprecated use {!val:option} instead. *) @@ -985,7 +985,7 @@ module Gen : sig @since 0.90 *) - val flatten_l : 'a t list -> 'a list t [@@deprecated "Use [flatten_list] instead"] + val flatten_l : 'a t list -> 'a list t [@@deprecated "Use [flatten_list] instead"][@@migrate { repl = Rel.flatten_list }] (** Generate a list of elements from individual generators. Shrinks on the elements of the list, in the list order. @@ -1001,7 +1001,7 @@ module Gen : sig @since 0.90 *) - val flatten_a : 'a t array -> 'a array t [@@deprecated "Use [flatten_array] instead"] + val flatten_a : 'a t array -> 'a array t [@@deprecated "Use [flatten_array] instead"][@@migrate { repl = Rel.flatten_array }] (** Generate an array of elements from individual generators. Shrinks on the elements of the array, in the array order. @@ -1017,7 +1017,7 @@ module Gen : sig @since 0.90 *) - val flatten_opt : 'a t option -> 'a option t [@@deprecated "Use [flatten_option] instead"] + val flatten_opt : 'a t option -> 'a option t [@@deprecated "Use [flatten_option] instead"][@@migrate { repl = Rel.flatten_option }] (** Generate an option from an optional generator. Shrinks towards [None] then shrinks on the value. @@ -1034,7 +1034,7 @@ module Gen : sig @since 0.90 *) - val flatten_res : ('a t, 'e) result -> ('a,'e) result t [@@deprecated "Use [flatten_result] instead"] + val flatten_res : ('a t, 'e) result -> ('a,'e) result t [@@deprecated "Use [flatten_result] instead"][@@migrate { repl = Rel.flatten_result }] (** Generate a result from [Ok gen], an error from [Error e]. Shrinks on [gen] if [Ok gen]. @@ -1466,7 +1466,7 @@ module Print : sig ['a] using [f], and then by {i printing} this value of type ['a] using [p]. *) - val comap : ('b -> 'a) -> 'a t -> 'b t [@@deprecated "Use [contramap] instead"] + val comap : ('b -> 'a) -> 'a t -> 'b t [@@deprecated "Use [contramap] instead"][@@migrate { repl = Rel.contramap }] (** @deprecated use {!contramap} instead. *) val tup2 : 'a t -> 'b t -> ('a * 'b) t @@ -1575,7 +1575,7 @@ module Shrink : sig {b Be careful about time and memory} as the resulting list can be huge *) - val int_aggressive : int -> int Seq.t [@@deprecated "Use [int_aggressive_towards 0] instead"] + val int_aggressive : int -> int Seq.t [@@deprecated "Use [int_aggressive_towards 0] instead"][@@migrate { repl = Rel.int_aggressive_towards 0 }] (** @deprecated Use [int_aggressive_towards 0] instead. @since 0.7 *) @@ -1674,7 +1674,7 @@ module Observable : sig ['a] using [f], and then by {i consuming} this value of type ['a] using [o]. *) - val map : ('b -> 'a) -> 'a t -> 'b t [@@deprecated "Use [contramap] instead"] + val map : ('b -> 'a) -> 'a t -> 'b t [@@deprecated "Use [contramap] instead"][@@migrate { repl = Rel.contramap }] (** @deprecated use {!contramap} instead. *) val option : 'a t -> 'a option t @@ -1977,17 +1977,17 @@ module TestResult : sig val is_failed : _ t -> bool (** Returns true iff the state is [Failed _] *) - val stats : 'a t -> ('a stat * (int,int) Hashtbl.t) list [@@deprecated "Use [get_stats] instead"] + val stats : 'a t -> ('a stat * (int,int) Hashtbl.t) list [@@deprecated "Use [get_stats] instead"][@@migrate { repl = Rel.get_stats }] (** Obtain statistics @since 0.6 @deprecated use {!get_stats} instead *) - val warnings : _ t -> string list [@@deprecated "Use [get_warnings] instead"] + val warnings : _ t -> string list [@@deprecated "Use [get_warnings] instead"][@@migrate { repl = Rel.get_warnings }] (** Obtain list of warnings @since 0.10 @deprecated use {!get_warnings} instead *) - val collect : _ t -> (string,int) Hashtbl.t option [@@deprecated "Use [get_collect] instead"] + val collect : _ t -> (string,int) Hashtbl.t option [@@deprecated "Use [get_collect] instead"][@@migrate { repl = Rel.get_collect }] (** Obtain statistics @since 0.6 @deprecated use {!get_collect} instead *)