\begin{code}
module Util where
+import SBP
indent [] = []
indent ('\n':q) = "\n "++(indent q)
join c [] = ""
join c [x] = x
join c (x:y) = x++c++(join c y)
+
+class FromTree a where
+ fromTree :: Tree -> a
+class FromTrees a where
+ fromTrees :: [Tree] -> a
+instance FromTree a => FromTree [a] where
+ fromTree (Tree _ c _) = map fromTree c
+instance FromTree String where
+ fromTree (Tree h c _) = h++(concatMap fromTree c)
+instance FromTrees String where
+ fromTrees ts = concatMap (fromTree :: Tree -> String) ts
+
\end{code}
\ No newline at end of file