tag:blogger.com,1999:blog-8130326826065983217.post7315757962915423467..comments2014-04-29T08:47:45.508+02:00Comments on splonderzoek: RFC: Extensible, typed scanf- and printf-like functions for HaskellAnonymoushttp://www.blogger.com/profile/02951502639017426632noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8130326826065983217.post-1191918191854511692009-06-27T16:11:22.353+02:002009-06-27T16:11:22.353+02:00@maltem:
It's true: xformat does not really g...@maltem:<br /><br />It's true: xformat does not really go beyond the printf/scanf model other than providing for type safety. How do translators typically deal with this?Anonymoushttps://www.blogger.com/profile/02951502639017426632noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-46648949319909527262009-06-27T12:56:11.659+02:002009-06-27T12:56:11.659+02:00Just my two cents: Relying on the order of argumen...Just my two cents: Relying on the order of arguments is a nice way to drive translators crazy. Extending this, or some other, type-safe printf library to allow for internatialization would be an interesting task to pursue.maltemnoreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-26596623263945046972009-06-26T10:18:53.565+02:002009-06-26T10:18:53.565+02:00@Bjorn:
This is great! I love Oleg's exposés ...@Bjorn:<br /><br /><em>This is great! I love Oleg's exposés and wish more of them got turned into libaries (e.g. static capabilities) rather than just proofs of concept.</em><br /><br />Strangely enough, this work was originally inspired by Oleg, but after some time, it no longer resembled his very much. Instead, it derives more directly from Hinze's paper referenced above.<br /><br /><em>I must agree with Martijn that the interface looks very clean and elegant. I'll be sure to excercise your libaray the next time I reach for Text.Printf.</em><br /><br />If/when you do use it, let me know how well it works for you and what could be changed or added. I'm sure there are a lot of "standard" formats that could be included. I just haven't spent the time on looking at that, yetAnonymoushttps://www.blogger.com/profile/02951502639017426632noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-69915527941753668662009-06-26T10:13:16.573+02:002009-06-26T10:13:16.573+02:00@Martijn:
Thanks for your comments! I appreciate ...@Martijn:<br /><br />Thanks for your comments! I appreciate your review. Here are some rsponses.<br /><br /><em><br />I think the interface is very clean and elegant. I'm happy that it doesn't use TH. I like that the types are so predictable and transparent.<br /></em><br /><br />Yeah, it worked out well to not use TH, I think. I will try to keep the types predictable.<br /><br /><em><br />I'm very curious about your new insights into functional dependencies as I'm still struggling to fully appreciate them. Perhaps you can write about this in some more detail in another post? :-)<br /></em><br /><br />If I get a chance, I will post something.<br /><br /><em><br />I think the modules on hackage could benefit from some good examples at the tops of the pages.<br /></em><br /><br />Agreed.<br /><br /><em><br />And a small silly style thingy: "readpf d1 >>= return . Left" can also be written as "Left <$> readpf d1" (or using liftM or fmap) which I think is somewhat prettier. I think this is one of hlint's suggestions too, but I'm not sure.<br /></em><br /><br />I like it. Done!<br /><br /><em><br />I am wondering what the crucial difference is between XFormat.Read and normal parser combinators. Is there something one can't do and the other can? Is one easier to use than the other? Parser combinators are extensible, too.<br /></em><br /><br />I don't think one is any more expressive than the other. As you saw, Text.XFormat.Read is built on top of the ReadP combinators. Perhaps it's bit easier to use readf with format descriptors than combinators, or perhaps it's the other way around. readf does give you an easy way to ensure types in the result.<br /><br /><em><br />You write that EitherF is fully symmetric (probably because ReadP's +++ is advertised as being fully symmetric), but how can this be? If a string can be parsed by both formats, does it yield a Left or a Right?<br /></em><br /><br />If I understand it correctly, I think (+++) will return the output with the shortest parse, regardless of which side it's on. On the other hand, (<++) always returns the left parsed result first if it the parse did not fail.Anonymoushttps://www.blogger.com/profile/02951502639017426632noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-79216967127385535492009-06-25T19:21:44.292+02:002009-06-25T19:21:44.292+02:00This is great! I love Oleg's exposés and wish ...This is great! I love Oleg's exposés and wish more of them got turned into libaries (e.g. static capabilities) rather than just proofs of concept.<br /><br />I must agree with Martijn that the interface looks very clean and elegant. I'll be sure to excercise your libaray the next time I reach for Text.Printf.Björn Buckwalterhttps://www.blogger.com/profile/14027110650075268096noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-64778782399246176952009-06-24T09:36:43.599+02:002009-06-24T09:36:43.599+02:00I think the interface is very clean and elegant. I...I think the interface is very clean and elegant. I'm happy that it doesn't use TH. I like that the types are so predictable and transparent.<br /><br />I'm very curious about your new insights into functional dependencies as I'm still struggling to fully appreciate them. Perhaps you can write about this in some more detail in another post? :-)<br /><br />I think the modules on hackage could benefit from some good examples at the tops of the pages.<br /><br />And a small silly style thingy: "readpf d1 >>= return . Left" can also be written as "Left <$> readpf d1" (or using liftM or fmap) which I think is somewhat prettier. I think this is one of hlint's suggestions too, but I'm not sure.<br /><br />I am wondering what the crucial difference is between XFormat.Read and normal parser combinators. Is there something one can't do and the other can? Is one easier to use than the other? Parser combinators are extensible, too.<br /><br />You write that EitherF is fully symmetric (probably because ReadP's +++ is advertised as being fully symmetric), but how can this be? If a string can be parsed by both formats, does it yield a Left or a Right?Martijnhttps://www.blogger.com/profile/03420202886083056827noreply@blogger.com