<div dir="ltr"><div>I imagine a parser that operates on (String,[String]) pairs, for which the second element allows the user to define precedence on the fly.</div><div><br></div><div>For instance, it would read the pair</div><div>  (x,y) = ("a , b : c", [":" , ","])</div><div>as </div><div>  "(a , (b : c))" </div><div>because y informs the parser that in x the colon binds first, then the comma.</div><div><br></div><div>I know it is possible, because Haskell does it already! In Haskell we can define novel infix operators on the fly, including their precedence relative to each other.</div><div><br></div><div>I don't know how, though, so that's my question.</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Jeffrey Benjamin Brown</div></div>
</div>