How can I define
pipe :: Handle -> Handle -> IO ()
in the most efficient way in Haskell (platform 2011-04 or ghc 7.4)?
Update 1: How to write a minimal-overhead proxy to localhost:3389 in Haskell?
Update 2: Using GNU/Linux system call `splice` for zero-copy Socket to Socket data transfers in Haskell
Uses the GNU/Linux system call splice for zero-copy data piping between two network sockets, also makes room for a portable socket-to-socket splice substitute written in Haskell, which uses (mallocBytes, hGetBufSome and hPutBuf) a one-time allocated user space buffer throughout the data transfer loop avoiding tiny allocations that lead to pressure on the garbage collector with repeated calls to recv, sendAll from the bytestring package.