MIT licensed by John Millikin
Maintained by Naïm Favier
This version can be pinned in stack with:knob-0.2.1@sha256:a0e49e620e6e587c9492aaf6c40a6c6370cd947b802fa0b4ed35e5edde82cd83,1355

Module documentation for 0.2.1

Used by 1 package in nightly-2022-11-17(full list with versions):

Create memory-backed Handles, 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)