On Monday, February 25, 2013 at 8:09 AM, Nils wrote:
Of course you don't have to use my library if your library alreadysolves the same problem.Am 25.02.2013 13:10, schrieb Alexander V Vershilov:data Result = Error Text ByteString | NeedMore (ByteString -> Result a)| HaveResult aI still see an issue with this if you're receiving multiple messages inone `ByteString` chunk. A type like `HaveResult a ByteString` which alsoreturns the leftover `ByteString` after the first result has been foundcould solve this, but you'd still have to re-yield this bytestring byhand and you'll possible end up with more calls to "decode" than necessary.Of course, with json you could avoid this problem by wrapping allmessages into a json-list and sending this list as one big message. Butthat way you lose almost all advantages of a conduit - you cannot mapover those list iems, you cannot process each item one by one, youcannot fold or filter them. When using this approach I don't really seethe advantage over using the plain old "connectTo/hGetContents" method?Anyway, my library is independent of the "bytestring encoding" you wantto use with it. I think it's the most general solution and avoids havingto re-implement the same solution for each and every "protocol design"over and over again._______________________________________________Haskell-Cafe mailing list