
On Wed, Jul 01, 2015 at 03:27:46AM +0900, Hiromi ISHII wrote:
Hi,
I'm currently writing a web app to check the spec of input code usging QuickCheck. quickCheck* functions writes results to stderr & stdout, but I don't want them written to the app's original stdout/err. (I'm using SafeHaskell features to avoid malicious code executed, so don't worry about that :-))
So I want to execute I/O action hijacking stdout/err in a thread-safe manner. For example, I need function like below:
censorHandles :: IO a -> IO (a, String, String) censorHandles = ...
or
withStd :: Handle -> Handle -> Handle -> IO a -> IO a withStd = ...
Just to make sure, you have set `chatty` to false and passed it to one of the other QuickCheck runners, right? http://hackage.haskell.org/package/QuickCheck-2.8.1/docs/Test-QuickCheck.htm... I haven't used it myself, but I was under the impression that's how one controls the use of stderr/stdout (well, at least stdout). /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Do not meddle in the affairs of Wizards, for they are subtle and quick to anger. -- J.R.R Tolkien