Prevent or capture writing to stdout and other handles.
|LTS Haskell 20.15:||220.127.116.11|
|Stackage Nightly 2023-03-24:||18.104.22.168|
|Latest on Hackage:||22.214.171.124|
Maintained by Sönke Hahn, Simon Hengel, Andreas Abel
This version can be pinned in stack with:
Module documentation for 126.96.36.199
Depends on 3 packages(full list with versions):
Used by 5 packages in lts-20.9(full list with versions):
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
Capturing/silencing might not work as expected if the action uses the FFI
or conceals output under
unsafePerformIO or similar unsafe operations.
- FFI: https://github.com/hspec/silently/issues/3
188.8.131.52 August 2022
- Tested with GHC 7.0 - 9.4.1.
- Remove remnants of GHC 6.x support.
- Silence incomplete pattern matching warning, refactor code.
- Add section about limitations to README.
184.108.40.206 November 2021
- Tested with GHC 7.0 - 9.2.
- Silence warning caused by missing
other-modulesin cabal file.
- Add README and CHANGELOG to dist.
220.127.116.11 July 2019
No changelog for this and earlier versions.