Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is _opt_map_n relevant for printers ? #204

Open
vch9 opened this issue Dec 3, 2021 · 3 comments
Open

Is _opt_map_n relevant for printers ? #204

vch9 opened this issue Dec 3, 2021 · 3 comments

Comments

@vch9
Copy link
Contributor

vch9 commented Dec 3, 2021

For instance:

# open QCheck;;
# let arb = pair small_int (always 0);;
val arb : (int * int) QCheck.arbitrary =
  {gen = <fun>; print = None; small = None; shrink = Some <fun>;
   collect = None; stats = []}

We could have the printer print (n, <no-printer>)? This could still be useful.

@vch9
Copy link
Contributor Author

vch9 commented Dec 3, 2021

I noticed the behavior while providing printers for #181

@vch9
Copy link
Contributor Author

vch9 commented Dec 3, 2021

What I propose is very similar to what you did for shrinkers:

let quad =
  ...
  ~shrink:(Shrink.quad
                   (_opt_or a.shrink Shrink.nil)
                   (_opt_or b.shrink Shrink.nil)
                   (_opt_or c.shrink Shrink.nil)
                   (_opt_or d.shrink Shrink.nil))
  ...

@c-cube
Copy link
Owner

c-cube commented Dec 3, 2021

You know, that makes a lot of sense. Good idea 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants