knob

Memory-backed handles https://john-millikin.com/software/knob/

Version on this page:0.1.1
LTS Haskell 8.2:0.1.1
Stackage Nightly 2017-02-22:0.1.1
Latest on Hackage:0.1.1
MIT licensed and maintained by John Millikin

Module documentation for 0.1.1

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 2 packages:
comments powered byDisqus