<div dir="ltr"><div>I'm trying this again! The comment for Megaparsec.makeExprParser refers to "parens". When I grep for "parens" in Megaparsec I get only two occurences, both of them in comments:</div><div><br></div><div><font face="monospace, monospace">    ./Lexer.hs:-- > parens    = between (symbol "(") (symbol ")")</font></div><div><font face="monospace, monospace">    ./Expr.hs:-- > term = parens expr <|> integer <?> "term"</font></div><div><br></div><div><font face="arial, helvetica, sans-serif">If I try defining parens as in the comment from Lexer.hs, I get these errors:</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">    <interactive>:37:33:</font></div><div><font face="monospace, monospace">        Couldn't match type ‘Char’ with ‘()’</font></div><div><font face="monospace, monospace">        Expected type: [()]</font></div><div><font face="monospace, monospace">          Actual type: [Char]</font></div><div><font face="monospace, monospace">        In the first argument of ‘symbol’, namely ‘"("’</font></div><div><font face="monospace, monospace">        In the first argument of ‘between’, namely ‘(symbol "(")’</font></div><div><font face="monospace, monospace">        In the expression: between (symbol "(") (symbol ")")</font></div><div><font face="monospace, monospace">    </font></div><div><font face="monospace, monospace">    <interactive>:37:46:</font></div><div><font face="monospace, monospace">        Couldn't match type ‘Char’ with ‘()’</font></div><div><font face="monospace, monospace">        Expected type: [()]</font></div><div><font face="monospace, monospace">          Actual type: [Char]</font></div><div><font face="monospace, monospace">        In the first argument of ‘symbol’, namely ‘")"’</font></div><div><font face="monospace, monospace">        In the second argument of ‘between’, namely ‘(symbol ")")’</font></div><div><font face="monospace, monospace">        In the expression: between (symbol "(") (symbol ")")</font></div><div><br></div><div>[1] <a href="https://hackage.haskell.org/package/megaparsec-5.0.1/docs/Text-Megaparsec-Expr.html">https://hackage.haskell.org/package/megaparsec-5.0.1/docs/Text-Megaparsec-Expr.html</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 29, 2016 at 2:05 AM, Özgür Akgün <span dir="ltr"><<a href="mailto:ozgurakgun@gmail.com" target="_blank">ozgurakgun@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 29 February 2016 at 08:22, Stephen Tetley <span dir="ltr"><<a href="mailto:stephen.tetley@gmail.com" target="_blank">stephen.tetley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
For the expression parser, Megaparsec's documentation is wrong[*] and<br>
probably it should use symbol rather than reservedOp. Note that symbol<br>
is slightly different in Megaparsec as it's a plain combinator (rather<br>
than one instantiated from a first class module as in Parsec) so it<br>
takes two args rather than one.<br>
<br>
<br>
[*] Well, likely wrong - I haven't got round to using Megaparsec yet.<br>
<div></div></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></span>You are right: <a href="https://github.com/mrkkrp/megaparsec/commit/750adb7c70392c3195eda12d816f4a1a2305321e" target="_blank">https://github.com/<wbr>mrkkrp/megaparsec/commit/<wbr>750adb7c70392c3195eda12d816f4a<wbr>1a2305321e</a><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><span style="font-size:small">Özgür Akgün</span><br></div></div></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
<br></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><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><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><br></div><div dir="ltr"><div dir="ltr"><a href="https://www.facebook.com/mejeff.younotjeff" target="_blank">Facebook</a></div><div dir="ltr"><a href="https://www.linkedin.com/in/jeffreybenjaminbrown" target="_blank">LinkedIn</a> (InMail is unreliable)</div><div><a href="https://github.com/jeffreybenjaminbrown" target="_blank">Github</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>