[Haskell] ANNOUNCE: silently-1.1.1 (api changes and fewer temp files)
trystan.s at comcast.net
Mon Apr 11 06:29:21 CEST 2011
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.
Another big thanks to everyone who had comments and suggestions,
As an example, the program
main = do
putStr "putStrLn: " >> putStrLn "puppies!"
putStr "silenced: " >> silence (putStrLn "kittens!")
(captured, result) <- capture (putStr "wookies!" >> return 123)
putStr "captured: " >> putStrLn captured
putStr "returned: " >> putStrLn (show result)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell