
On Fri, Jan 19, 2007 at 11:19:16 +0100, Ferenc Wagner wrote:
Magnus Therning
writes: Thanks for all the excellent answers to my original question. Somehow it feels like I advanced and got one level closer to a black belt in Haskell due to this; I've now legitimately used a function from System.IO.Unsafe :-)
I tried to document it all: http://therning.org/magnus/archives/249
I wonder whether the unsafeInterleaved solution is guarranteed to work as per your specification. Couldn't it read a character, write it, then read three characters, write two, read one more then write two again, and so on? It has to catch up at the end, but needn't stay synchronized during the process, perhaps...
Good point! However, for my uses right now it doesn't matter. So rather than find a problem with the code you've found a problem with my requirements. Of course that's a good thing as well since you've helped me understand the problem better :-) /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus.therning@gmail.com http://therning.org/magnus