Closed
Description
This has been freaking me out recently. Given,
a: Parser[A]
b: Parser[B]
c: Parser[C]
d: Parser[D]
a ~ b ~ c ~ d // => Parser[A ~ B ~ C ~ D]
a ~ b ~> c ~ d // => Parser[A ~ C ~ D] (edit: should be Parser[C ~ D])
a ~ b <~ c ~ d // => Parser[A ~ B]
because <~
is lower precedence than ~
and ~>
. So you have to add parentheses if you want things to work as you might expect in a left-to-right fashion, i.e.
a ~ (b <~ c) ~ d // => Parser[A ~ B ~ D]
What would people think of adding an alias of ~<
for <~
, which would have the same precedence as the other two, so
a ~ b ~< c ~ d // => Parser[A ~ B ~ D]
Or maybe I'm the only one who is freaked out/annoyed by this?
Metadata
Metadata
Assignees
Labels
No labels