[Haskell-cafe] Wondering about networking programming in Haskell.

Magicloud Magiclouds magicloud.magiclouds at gmail.com
Thu Jan 20 04:19:02 CET 2011


Hi,
  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 mailing list