Silently, a package to prevent or capture output to handles, has undergone some api changes for version 1.1.1.
silently and hSilently have been renamed to silence and hSilence. hSilence and hCapture now take a list of handles instead of just one. silence :: IO a -> IO a hSilence :: [Handle] -> IO a -> IO a capture :: IO a -> IO (String, a) hCapture :: [Handle] -> IO a -> IO (String, a) The 'capture' and 'hCapture' functions still use temp files behind the scenes. The 'silence' and 'hSilence' functions will write to the NUL device on Windows, to /dev/null on OSX and Linux, and use a temp file on other operating systems. Any temp files will be created in the temp folder if your system has one or the current directory if not. http://hackage.haskell.org/package/silently https://github.com/trystan/silently Another big thanks to everyone who had comments and suggestions, Trystan Spangler As an example, the program import System.IO.Silently main = do putStr "putStrLn: " >> putStrLn "puppies!" putStr "silenced: " >> silence (putStrLn "kittens!") putStrLn "" (captured, result) <- capture (putStr "wookies!" >> return 123) putStr "captured: " >> putStrLn captured putStr "returned: " >> putStrLn (show result) will print putStrLn: puppies! silenced: captured: wookies! returned: 123
_______________________________________________ Haskell mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell
