
2 Feb
2010
2 Feb
'10
7:34 a.m.
Correction about the latter part...
In the end, I would write something like the following:
unGen arbitrary (mkStdGen 11) 5 :: [Int]
This produces, for example, [5,1,-2,-4,2]. I also want to generate the same value for a type isomorphic to [Int].
unGen arbitrary (mkStdGen 11) 5 :: List Int
Unfortunately, this produces Cons 4 (Cons 3 (Cons (-2) (Cons 0 (Cons (-1) Nil)))): same length but different values. The Arbitrary instances are the same.
The Arbitrary instance were _slightly_ different, but different enough. ;) Now, the values are isomorphic. Thankfully, purity is restored. Sean