Package Info

ghc-knob


Memory-backed handles


Development/Libraries/Haskell

Create memory-backed 'Handle's, referencing virtual files. This is mostly useful for testing 'Handle'-based APIs without having to interact with the filesystem.

> import Data.ByteString (pack) > import Data.Knob > import System.IO > > main = do > knob <- newKnob (pack []) > h <- newFileHandle knob "test.txt" WriteMode > hPutStrLn h "Hello world!" > hClose h > bytes <- Data.Knob.getContents knob > putStrLn ("Wrote bytes: " ++ show bytes).


License: MIT
URL: https://hackage.haskell.org/package/knob

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.1.1-bp150.2.4 info GA Release 2018-08-01 15
  • AArch64
  • ghc-knob
  • ghc-knob-devel
0.1.1-bp150.2.6 info GA Release 2018-07-30 15
  • ppc64le
  • x86-64
  • ghc-knob
  • ghc-knob-devel