Parsing non binary operators with Parsec
问题 Traditionally, arithmetic operators are considered to be binary (left or right associative), thus most tools are dealing only with binary operators. Is there an easy way to parse arithmetic operators with Parsec, which can have an arbitrary number of arguments? For example, the following expression should be parsed into the tree (a + b) + c + d * e + f 回答1: Yes! The key is to first solve a simpler problem, which is to model + and * as tree nodes with only two children. To add four things, we