silently

Prevent or capture writing to stdout and other handles.

https://github.com/hspec/silently

Version on this page:1.2.5.2
LTS Haskell 19.27:1.2.5.3
Stackage Nightly 2022-10-05:1.2.5.3
Latest on Hackage:1.2.5.3

See all snapshots silently appears in

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-1.2.5.2@sha256:1496b654d2113b9653d14f92e39acb40d0e1ed5de830214857191622b8ed4653,2302

Module documentation for 1.2.5.2

Hackage version silently on Stackage Nightly Stackage LTS version Cabal build

silently

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!
 silenced:
 captured: wookies!
 returned: 123

Changes

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

1.2.5.1 July 2019

No changelog for this and earlier versions.