I have a function with the following type signature
rndListIndex :: Double -> Double -> Double -> Double
rndListIndex maxIdx r1 r2 = …
- the first input should be a value coming from a
non-negativestrictly positive integer - the second and third input are required to be within the closed interval [0.0,1.0] otherwise the function makes no sense
the function has the property of
prop_alwaysLessThanMaxIdx idx r1 r2 = (rndListIndex idx r1 r2 <= idx)
how do I generate random data for maxIdx
and r1
,r2
separately; I know of the function choose
but do not know how to use it with more than one input variable.
For now I have tested the Property with fixed idx
, which is not the way it should be tested.