<div dir="ltr">Thanks, Brandon! How did you know that?<div><br></div><div>I changed them to "#1" and "#2" and now it works[1].</div><div><br></div><div>But before making that change, why would "a # b ## c # d" evaluate, even though "a ## b" would not?</div><div><br></div><div><br></div><div><div>[1] <a href="https://github.com/JeffreyBenjaminBrown/digraphs-with-text/tree/master/howto/megaparsec">https://github.com/JeffreyBenjaminBrown/digraphs-with-text/tree/master/howto/megaparsec</a></div><div>The corrected file is called "experim.hs"; the old one, uncorrected, is called "experim.buggy.hs".</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 23, 2016 at 2:03 PM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class=""><br><div class="gmail_quote">On Sun, Oct 23, 2016 at 4:15 PM, Jeffrey Brown <span dir="ltr"><<a href="mailto:jeffbrown.the@gmail.com" target="_blank">jeffbrown.the@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><font face="monospace, monospace">      [ [ InfixN # symbol "#" *> pure (Pair) ]</font></div><div><font face="monospace, monospace">      , [ InfixN # symbol "##" *> pure (Pair) ]</font></div><div><font face="monospace, monospace">      ]</font></div></blockquote></div><div class="gmail_extra"><br></div></span>Combinator parsers can't rearrange themselves to do longest token matching. So the ## operator will take the first case, match against `symbol "#"` and aOperator will succeed; the the next token match will hit the unconsumed "#" and fail. If you place "##" first then it will match "##" but not "#", which would the match the second rule.</div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><div><br></div>-- <br><div class="m_1643006919693412385gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Jeff Brown | Jeffrey Benjamin Brown</div><div dir="ltr"><a href="https://msu.edu/~brown202/" style="font-size:12.8px" target="_blank">Website</a>   |   <a href="https://www.facebook.com/mejeff.younotjeff" style="font-size:12.8px" target="_blank">Facebook</a>   |   <a href="https://www.linkedin.com/in/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">LinkedIn</a><span style="font-size:12.8px">(I often miss messages here)   |   </span><a href="https://github.com/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">Github</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>