[Haskell-cafe] Wondering about networking programming in Haskell.
magicloud.magiclouds at gmail.com
Thu Jan 20 04:19:02 CET 2011
Originally, my idea for networking programming is like: read some
bytes, judge if this is enough for a packet (defined in certain
protocol), if not, read more until the packet is complete, then parse
it into a message.
Now we have lazy in Haskell. Can I do it as:
buffer <- hGetContents handle
(message1, leftData1) <- parse1 buffer
(message2, leftData2) <- parse2 leftData2
More information about the Haskell-Cafe