knob: Memory-backed handles
Create memory-backed Handle
s, 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)
Downloads
- knob-0.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Versions [RSS] | 0.1, 0.1.1, 0.2 |
---|---|
Dependencies | base (>=4.15 && <5), bytestring (>=0.9 && <0.12), transformers (>=0.2 && <0.7) [details] |
License | MIT |
Author | John Millikin <jmillikin@gmail.com> |
Maintainer | Naïm Favier <n@monade.li> |
Category | System |
Home page | https://github.com/ncfavier/knob |
Bug tracker | https://github.com/ncfavier/knob/issues |
Source repo | head: git clone https://github.com/ncfavier/knob |
Uploaded | by ncfavier at 2022-03-25T23:47:28Z |
Distributions | Arch:0.1.1, Debian:0.1.1, NixOS:0.2 |
Downloads | 6030 total (41 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user [build log] All reported builds failed as of 2022-03-26 [all 2 reports] |