Skip to main content
9 events
when toggle format what by license comment
May 23, 2017 at 12:41 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Aug 2, 2015 at 8:03 comment added ErikR You're right. mainLength doesn't run the parser on each line. mainSum does force the parser to run.
Aug 2, 2015 at 0:25 comment added Frank Wang I have a question about your interpretation of your mainLength timing. It seems like mainLength does not actually tell us anything about the performance of the parser. Since the whole thing is lazy evaluated, it doesn't seem as if the ghc does anything to the raw input besides splitting it with LB.words. I tested this by running mainLength without mapping on the parser ie. only counting the length of the input string, and there was no difference in timing with or without the parser.
Aug 1, 2015 at 21:35 comment added ErikR I've updated the answer with a new optimization.
Aug 1, 2015 at 21:35 history edited ErikR CC BY-SA 3.0
added 780 characters in body
Aug 1, 2015 at 20:04 history edited ErikR CC BY-SA 3.0
added 763 characters in body
Aug 1, 2015 at 19:14 comment added Frank Wang Thank you, this is a fantastic answer. I will look read through your suggestions and patch up the parser today.
Aug 1, 2015 at 19:10 review First posts
Aug 1, 2015 at 20:13
Aug 1, 2015 at 19:09 history answered ErikR CC BY-SA 3.0