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

Module documentation for 0.2

Used by 1 package in nightly-2022-08-04(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)