QuickCheck - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sandy Maguire

can I give "suggested" values to a quickcheck Gen? like, i want to run a generator, but sort of bias it towards some values.

Sandy Maguire

more generally i have two arbitrary-arity functions and i would like to find a set of arguments for each that make the functions equate

Sandy Maguire

any non-trivial solution here is fine

Sandy Maguire

my current strategy is to generate an arbitrary set of args for the higher-arity one, and then bias the arguments generated for the second function to try to use the values i generated for the first one

Sandy Maguire

it doesn't work very well, i think probably because i am doing an independent sampling from that biased set

Simon Hudon

Have you considered forAll and oneof or frequency?

Sandy Maguire

yeah, i looked at those. i think my new plan is to write unification

Sandy Maguire

biased sampling has lots of problems it turns out

Simon Hudon

What kind of problems?

Sandy Maguire

primarily that it doesn't solve the problem

Sandy Maguire

wow! did yall know that the shrink method in Arbitrary is _not_ defined as genericShrink?