
22 Sep
2008
22 Sep
'08
9:10 p.m.
aeyakovenko:
If i have functions in the IO monad, is there a way to use quickcheck to test them? I have a bunch of C bindings that unfortunately are not "safe". But i would like to be able to use QuickCheck to test them.
Typically, via unsafePerformIO, and check the invariants that need to hold for that to be safe by hand. E.g. prop_foo x = unsafePerformIO $ do writeFile "f" x y <- readFile "f" return (x == y) -- Don