
2 Dec
2004
2 Dec
'04
6:47 a.m.
On Thu, Dec 02, 2004 at 01:16:31AM -0800, William Lee Irwin III wrote:
I've been wondering how to do mmap() in Haskell since I don't know how to get things to interact with the runtime system etc.
Actually, similar questions apply to asynchronous IO.
The foreign function interface is nice and all, but modelling the result with types and interoperating with the runtime system is the real question here.
You could take a look at FastPackedString.hs in darcs, which calls mmap to read strings, and uses ForeignPtrs to hold their data, so you don't have to copy the memory over. -- David Roundy http://www.darcs.net