úλ;Takes an IO as action to run, and a String as given stdin, ; then returns whole stdout and stderr as String of tuple.  $ import System.IO.Capture (capture)  8 main = print =<< capture (getLine >>= putStr) "foobar"  -- prints ("foobar","") !WARNING: If Lazy Reading such as  getContents was contained in the 8 action, its behavior is very strange. For detail, see  tests/ Tests.hs. io-capture-0.2System.IO.CapturecapturereadFile getContents hGetContents withTempFileignoringException