cabal-version: 2.4 name: knob version: 0.2.1 license: MIT license-file: license.txt author: John Millikin maintainer: Naïm Favier build-type: Simple tested-with: GHC == 9.0.2, GHC == 9.2.1 category: System stability: experimental homepage: https://github.com/ncfavier/knob bug-reports: https://github.com/ncfavier/knob/issues 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: git location: https://github.com/ncfavier/knob library default-language: Haskell2010 hs-source-dirs: lib ghc-options: -Wall build-depends: base >= 4.15 && < 5 , bytestring >= 0.9 && < 0.12 , transformers >= 0.2 && < 0.7 exposed-modules: Data.Knob