gpc icon indicating copy to clipboard operation
gpc copied to clipboard

Disambiguate precedence (biased 'or')

Open noughtmare opened this issue 1 year ago • 0 comments

We should introduce a biased <<|> operator which only backtracks if its left argument fails but otherwise commits to the first branch. This can be used to disambiguate precedence, e.g.

       (+) <$> expr <* char '+' <*> expr 
  <<|> (*) <$> expr <* char '*' <*> expr

noughtmare avatar Jun 12 '23 11:06 noughtmare