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
...
-- 
竹密岂妨流水过
山高哪阻野云飞

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to