tag:blogger.com,1999:blog-927289640963145319.post501569422644910440..comments2023-12-07T00:46:00.649-08:00Comments on Johan Tibell: Merging binary and cerealJohan Tibellhttp://www.blogger.com/profile/06875432206357419172noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-927289640963145319.post-1678269040586697522011-01-06T07:37:18.636-08:002011-01-06T07:37:18.636-08:00Aleksey,
I'm not sure who will make the modif...Aleksey,<br /><br />I'm not sure who will make the modifications. If I had the time I would attempt them myself, but as I mentioned in the previous posts these are projects I like to see done but where I don't have the time to work on. Hopefully I can convince the maintainers that this is a good thing and they will have some time to work on it together.<br /><br />Yes, there is the Alternative instance. I think the "standard" continuation based design can support that without too much trouble (e.g. attoparsec already does).Johan Tibellhttps://www.blogger.com/profile/06875432206357419172noreply@blogger.comtag:blogger.com,1999:blog-927289640963145319.post-83486893377428485702011-01-06T07:31:02.320-08:002011-01-06T07:31:02.320-08:00I think merge is best case scenario. And cereal sh...I think merge is best case scenario. And cereal should be merged into binary. But I think that critical component is missing. Who will do such modifications?<br /><br />Also Get from cereal have Alternative instance whereas one from binary doesn't. <br /><br />If we have function which checks for end of input isolate which checks that all input has been consumed could be written as:<br /><br />isolate' n g = isolate n (g *> eof)Aleksey Khudyakovhttps://www.blogger.com/profile/05397127755155923531noreply@blogger.comtag:blogger.com,1999:blog-927289640963145319.post-19529723447779881082011-01-05T23:23:39.334-08:002011-01-05T23:23:39.334-08:00Link fixed. Thanks.Link fixed. Thanks.Johan Tibellhttps://www.blogger.com/profile/06875432206357419172noreply@blogger.comtag:blogger.com,1999:blog-927289640963145319.post-29079995762630659112011-01-05T23:13:33.596-08:002011-01-05T23:13:33.596-08:00moltar,
You're right that isolate does a litt...moltar,<br /><br />You're right that isolate does a little bit more than I described. I'm not sure if requiring the parser to consume exactly the specified amount of input is an essential feature of isolate. I'll have to think about it.<br /><br />Error handling would definitely make it into the merger as the Result data type I described in the last post includes a Fail constructor which is intended to be used for that purpose.<br /><br />Stack traces are nice if they don'y hurt performance too much. I believe Lennart added them to his branch of binary but they hurt performance a lot.Johan Tibellhttps://www.blogger.com/profile/06875432206357419172noreply@blogger.comtag:blogger.com,1999:blog-927289640963145319.post-80794944869160350212011-01-05T23:13:14.900-08:002011-01-05T23:13:14.900-08:00The "cereal package" link is broken, it ...The "cereal package" link is broken, it points to "http://package.haskell.org/package/cereal".Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-927289640963145319.post-14924055287179858912011-01-05T16:56:34.927-08:002011-01-05T16:56:34.927-08:00isolate goes a little bit further that just isolat...isolate goes a little bit further that just isolating to that portion of the input. It also requires the Get operation passed to consume exactly the input that is provided.<br /><br />Cereal also provides a debugging interface, that will dump a stack trace when a parse error happens. You can hook into this functionality via the label function.<br /><br />I would really like to see these functions make their way into a merger, as well as some method of error handling; they have been invaluable in day to day work for me.Anonymousnoreply@blogger.com