I want to write a parser that lets someone write "(a #uses b) #because (c #needs d)" and read it into a tree:data Tree = Tree String Tree Tree | Leaf Stringmagic "(a #uses b) #because (c #needs d)"= Tree "because" (Tree "uses" (Leaf "a") (Leaf "b"))(Tree "needs" (Leaf "c") (Leaf "d"))I thought I could use Text.Megaparsec.Expr for it, but now I realize it hadnles binary operations, and this is a ternary one.Suggestions?--
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.