[Haskell-cafe] In-memory Handle for testing

Antoine Latter aslatter at gmail.com
Fri Jan 20 17:36:44 CET 2012


On Fri, Jan 20, 2012 at 5:53 AM, Simon Hengel <sol at typeful.net> wrote:
> For testing I want to stub handles, performing all reads and writes in
> memory (and in process, so no mmap).  From looking at the documentation
> of mkFileHandle[1], I think this should be possible.  But it requires
> some work.  Is there already something out there?
>

John Miliken has one on Hackage:

http://hackage.haskell.org/package/knob

I had a read-only version that I used for testing things a ways back:

http://hackage.haskell.org/trac/ghc/attachment/ticket/4144/ByteStringHandle.hs

There might still be some things in GHC.IO.Handle that assume FD
handles - I haven't tried it in a while.

Antoine



More information about the Haskell-Cafe mailing list