BSD-3-Clause licensed by Trystan Spangler
Maintained by Sönke Hahn, Simon Hengel, Andreas Abel
This version can be pinned in stack with:silently-,2302

Module documentation for

Used by 4 packages in nightly-2022-08-17(full list with versions):

Hackage version silently on Stackage Nightly Stackage LTS version Cabal build


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 capture.

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)

will print:

 putStrLn: puppies!
 captured: wookies!
 returned: 123

Changes November 2021

  • Tested with GHC 7.0 - 9.2.
  • Silence warning caused by missing other-modules in cabal file.
  • Add README and CHANGELOG to dist. July 2019

No changelog for this and earlier versions.