<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Am Di., 9. Okt. 2018 um 09:18 Uhr schrieb Vladislav Zavialov <<a href="mailto:vlad.z.4096@gmail.com">vlad.z.4096@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[...] With parser combinators<br>
<br>
1. Parse into an expression (linear in the amount of tokens)<br>
2. If it turns out we needed a pattern, backtrack and parse into a<br>
pattern (linear in the amount of tokens) [...]<br></blockquote><div><br></div><div>In a larger grammar implemented by parser combinators it is quite hard to guarantee that you don't backtrack while backtracking, which would easily result in exponential runtime. And given the size of the language GHC recognizes, I can almost guarantee that this will happen unless you use formal methods. :-)</div><div><br></div><div>Cheers,</div><div> S.</div></div></div>