Silently is a package that allows you to run an
IO action and
prevent it from writing to
stdout, or any other handle, by using
silence. Or you can capture the output for yourself using
For 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)
putStrLn: puppies! silenced: captured: wookies! returned: 123
18.104.22.168 November 2021
- Tested with GHC 7.0 - 9.2.
- Silence warning caused by missing
other-modulesin cabal file.
- Add README and CHANGELOG to dist.
22.214.171.124 July 2019
No changelog for this and earlier versions.