Currently, we have to pattern match a lot on children, or check if any of the children satisfy some predicate. A list is not always reasonable representation (for example, we know that function node should have exactly 2 children). So it would be nice to have some nicer way to express such expectations.
Seems like we want something like parser combinators but for Trees.
Currently, we have to pattern match a lot on children, or check if any of the children satisfy some predicate. A list is not always reasonable representation (for example, we know that function node should have exactly 2 children). So it would be nice to have some nicer way to express such expectations. Seems like we want something like parser combinators but for Trees.