MIT licensed and maintained by John Millikin

Module documentation for 0.1.1

This version can be pinned in stack with:[email protected]:8dd62f0470fd829d5c4137b5ecfb0cb9a04a829fa8f436959d460019b3a6f118,1401

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)
Used by 1 package in lts-7.24(full list with versions):