file-iohaskellio

How do I create an in-memory handle in Haskell?


I want something that looks like a file handle but is really backed by an in-memory buffer to use for I/O redirects. How can I do this?


Solution

  • It's not possible without modifying the compiler. This is because Handle is an abstract data type, not a typeclass.