I want to generate values, so that i have some arbitrary object, which has a
certain set of signals, and each set of signals has a certain set of sensor
value pairs, were the values are arbitrary.
However to demonstrate my problem I have an easy example, were I want to
generate an instance of
You're generating two random values, where you probably want to just
generate one and then calculate the second from it. Try this:
instance Arbitrary QCExample where
arbitrary = do
i1 - arbitrary
return (QCExample i1 (i1 * 2))
2010/8/25 Jürgen Nicklisch-Franken j...@arcor.de:
Excerpts from Jürgen Nicklisch-Franken's message of Wed Aug 25 23:32:51 -0400
2010:
instance Arbitrary QCExample where
arbitrary =
let i1 = arbitrary
i2 = fmap (* 2) i1
in liftM2 QCExample i1 i2
What's happening here is that you are evaluating the random
2010/8/26 Jürgen Nicklisch-Franken j...@arcor.de:
I want to generate values, so that i have some arbitrary object, which has a
certain set of signals, and each set of signals has a certain set of sensor
value pairs, were the values are arbitrary.
However to demonstrate my problem I have an
Thank you all, (you are responding so quick that I consider to stop
thinking myself in the future and just ask).
Jürgen
Am Donnerstag, den 26.08.2010, 00:02 -0400 schrieb Edward Z. Yang:
Excerpts from Jürgen Nicklisch-Franken's message of Wed Aug 25 23:32:51 -0400
2010:
instance Arbitrary
2010/8/26 Jürgen Nicklisch-Franken j...@arcor.de:
Thank you all, (you are responding so quick that I consider to stop
thinking myself in the future and just ask).
No, no, don't stop thinking: if you stop thinking, how are you going
to be able to instantly answer someone else's question?
(You