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

Module documentation for 0.2.2

Used by 1 package in nightly-2024-09-12(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)