name: knob version: 0.1.1 license: MIT license-file: license.txt author: John Millikin maintainer: John Millikin build-type: Simple cabal-version: >= 1.6 category: System stability: experimental homepage: https://john-millikin.com/software/knob/ bug-reports: mailto:jmillikin@gmail.com synopsis: Memory-backed handles description: 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) extra-source-files: scripts/common.bash scripts/run-coverage scripts/run-tests -- tests/knob-tests.cabal tests/KnobTests.hs source-repository head type: bazaar location: https://john-millikin.com/software/knob/ source-repository this type: bazaar location: https://john-millikin.com/branches/knob/0.1/ tag: knob_0.1.1 library hs-source-dirs: lib ghc-options: -Wall -O2 build-depends: base >= 4.2 && < 5.0 , bytestring >= 0.9 , transformers >= 0.2 exposed-modules: Data.Knob