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

Module documentation for 0.2.2

Used by 1 package in lts-20.24(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)