File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 8181- Renamed monadic and applicative generator combinators:
8282 - Add missing ` QCheck.Gen.bind ` for consistency
8383 - Add missing ` QCheck.Gen.ap ` for consistency
84+ - Add missing ` QCheck2.Gen.map_keep_input ` for consistency
8485
8586
8687## 0.27 (2025-10-31)
Original file line number Diff line number Diff line change @@ -352,6 +352,8 @@ module Gen = struct
352352
353353 let map5 = liftA5
354354
355+ let map_keep_input f x = fun st -> Tree. map (fun a -> a, f a) (x st)
356+
355357 let return = pure
356358
357359 let bind (gen : 'a t ) (f : 'a -> ('b t) ) : 'b t = fun st ->
Original file line number Diff line number Diff line change @@ -1181,6 +1181,15 @@ module Gen : sig
11811181 @since 0.25
11821182 *)
11831183
1184+ val map_keep_input : ('a -> 'b ) -> 'a t -> ('a * 'b ) t
1185+ (* * [map_keep_input f g] transforms a generator [g] by applying [f] to each generated element.
1186+ Returns both the generated element from [g] and the output from [f].
1187+
1188+ Shrinks towards the shrinks of [g] with [f] applied to them.
1189+
1190+ @since NEXT_RELEASE
1191+ *)
1192+
11841193 val ap : ('a -> 'b ) t -> 'a t -> 'b t
11851194 (* * [ap fgen gen] composes a function generator and an argument generator
11861195 into a result generator.
You can’t perform that action at this time.
0 commit comments