I'm trying to learn arrows, as well as how PArrows can replace Parsec, but there is an almost nonexistent number of tutorials. I believe we could benefit a lot from simple examples, so, given the binary tree:
data Tree = Node Tree Tree | A | B deriving Show
How can PArrow be used to parse a string similar to:
"((A B) (A (B A)))"
So that it becomes:
Node (Node A B) (Node A (Node B A))
This is probably not the cleanest answer, but I managed to do it with:
Mind I'm still working on my arrow familiarity.