1> module Tree where 2 3> data Tree a b 4> = Plus a a 5> | Times a a 6> | Minus a a 7> | Pars a 8> | Const b 9> deriving (Show) 10 11Note: 12 + we need a construct for the location of parentheses 13 + sometimes it is useful to keep this information anyway -- eg ghc's 14 implementation of customisable prec & assoc. 15 + I've left Trees polymorphic in the "branch" type - this supports labelling 16 the forest with Int-based trees then switching to Tree-based trees later 17 + But this might require some non-Haskell-98 flags for the related class 18 instances. 19 20