[Haskell-cafe] QuickChecking IO

2006-05-25 Thread Mike Gunter
I'd like to use QuickCheck on IO code. For instance, I'd like to check a property of type String - IO Bool. Using unsafePerformIO seems straightforward (though I haven't written the code, so I may be wrong about that) and it might be possible to make a solution involving unsafeInterleaveIO

Re: [Haskell-cafe] QuickChecking IO

2006-05-25 Thread Twan van Laarhoven
Mike Gunter wrote: I'd like to use QuickCheck on IO code. For instance, I'd like to check a property of type String - IO Bool. Using unsafePerformIO seems straightforward (though I haven't written the code, so I may be wrong about that) and it might be possible to make a solution involving

Re: [Haskell-cafe] QuickChecking IO

2006-05-25 Thread Malcolm Wallace
Mike Gunter [EMAIL PROTECTED] wrote: I'd like to use QuickCheck on IO code. For instance, I'd like to check a property of type String - IO Bool. Barring that, I suspect it's possible modify QuickCheck to accommodate IO code (or perhaps, general monadic code). Has anyone done this? Yes,

Re: [Haskell-cafe] QuickChecking IO

2006-05-25 Thread Mike Gunter
I found the code at: http://www.cs.chalmers.se/~rjmh/QuickCheck/QuickCheckM.hs The only deconstructor there for PropertyM requires a run function of type m Property - Property. For IO, run is unsafePerformIO. -m Malcolm Wallace [EMAIL PROTECTED] writes: Mike Gunter [EMAIL PROTECTED]