Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Prevent or capture output to stdout or other handles in Haskell
Haskell
branch: master

Merge pull request #18 from sol/master

GHC 6.10.* compatibility
latest commit 38e523aae3
@trystan authored
Failed to load latest commit information.
src/System/IO
test Use nanospec for tests
.ghci Use same source file for UNIX and Windows
.gitignore updated package description
.travis.yml
LICENSE
README made it work on windows
Setup.lhs added missing files
fileLeakTest.hs file to test max open handles
silently.cabal

README

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
Something went wrong with that request. Please try again.