<html><head></head><body><div><div><div><div class="">Do you provide reproducible benchmarks for these claims? I'd love to see the outcome for various types of projects to make the choice for myself. <br/></div><div class=""><br/></div><div class="">Unsubstantiated claims of "This is Faster<img src="https://emojis.superhuman.com/2122.png" alt="™" title="™" style="height: 15px !important; width: 15px !important; vertical-align: text-bottom !important;" height="15" width="15"/>️" are the path to shame and treachery. <br/></div></div><div><div style="display: none; border: 0px; width: 0px; height: 0px; overflow: hidden; visibility: hidden;"><img src="https://r.superhuman.com/GjVtJcSnCO3jmnLySBjGbZEVp734LicqsJIeQ2KgHuZqaGc_3IJK6xzITW5Vg1bMO_-HO1xA68GLrZqoJ4c6TwZSRyZAU6kePuNIT1AYhzmFAGKgMNUO707wSe86O7mgFL6nDgCH8xwLeMi43GcjmoNhpaXKKtg6V_ffxOdGfJy7UVp5IAbz3wO0JAM.gif" alt=" " width="1" height="0" style="display: none; border: 0px; width: 0px; height: 0px; overflow: hidden; visibility: hidden;"/><!--                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                --></div><br/><div class="gmail_signature"></div></div><br/><div><div class="gmail_quote">On Tue, Nov 08, 2022 at 1:31 PM, Olaf Klinke <span dir="ltr"><<a href="mailto:olf@aatal-apotheke.de" target="_blank">olf@aatal-apotheke.de</a>></span> wrote:<br/><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote sh-color-black sh-color"><p class="sh-color-black sh-color">Dear Haskellers,
</p><p class="sh-color-black sh-color">
megaparsec [1] is a parsing library with excellent error
reporting. Being able to emit decent parse error messages is traded off
against speed, however. Wouldn't it be nice to have a faster parser for
your daily parsing needs, but obtain megaparsec's informative error
messages for the rare cases when things go wrong? 
</p><p class="sh-color-black sh-color">
Thanks to megaparsec's parser type class, MonadParsec, you can have
both: I wrote a MonadParsec instance for StateT s Maybe (s being the
input stream type such as Text or ByteString) which does not do all the
bookkeeping ParsecT needs to do. If you manage to write your parser
only using the type class primitives, then you can specialize your
parser to StateT s Maybe. Only if that returns Nothing specialize again
to ParsecT Void s and parse the input again, thus obtaining a decent
error message. The package faster-megaparsec [1,2] provides a
convenient function to do just that. 
</p><p class="sh-color-black sh-color">
Of course StateT s Maybe can not provide all the features ParsecT has:
<br/>
* StateT s Maybe is always backtracking.
<br/>
* It does not know the offset in the stream.
<br/>
* It must hold the entire input stream in memory for a second pass, 
so no garbage collecting the consumed input while parsing.
So if your parsing relies on non-backtracking choice, stream offset or
garbage-collecting input while parsing, you can not use faster-
megaparsec as a drop-in replacement. 
</p><p class="sh-color-black sh-color">
Happy parsing!
<br/>
Olaf
</p><p class="sh-color-black sh-color">
[1] <a target="_blank" rel="noopener noreferrer" href="https://hackage.haskell.org/package/megaparsec" class="sh-color-blue sh-color">https:/<wbr/>/<wbr/>hackage.<wbr/>haskell.<wbr/>org/<wbr/>package/<wbr/>megaparsec</a>
<br/>
[2] <a target="_blank" rel="noopener noreferrer" href="https://hackage.haskell.org/package/faster-megaparsec" class="sh-color-blue sh-color">https:/<wbr/>/<wbr/>hackage.<wbr/>haskell.<wbr/>org/<wbr/>package/<wbr/>faster-megaparsec</a> 
<br/>
[3] https://hub.darcs.net/olf/faster-megaparsec
</p><p class="sh-color-black sh-color">
_______________________________________________
<br/>
Haskell-Cafe mailing list
<br/>
To (un)subscribe, modify options or view archives go to:
<a target="_blank" rel="noopener noreferrer" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" class="sh-color-blue sh-color">http:/<wbr/>/<wbr/>mail.<wbr/>haskell.<wbr/>org/<wbr/>cgi-bin/<wbr/>mailman/<wbr/>listinfo/<wbr/>haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</p></div></div></blockquote></div></div><br/></div></div></body></html>