summaryrefslogblamecommitdiff
path: root/70b-73/73.hs
blob: 0db324eef39b4cec1f865a2d34fcfdf854786ac3 (plain) (tree)
1
2
3
4
5
6
7






                                                                                  
import Data.List (intersperse)
data Tree a = Node a [Tree a] deriving (Eq, Show)

display :: Tree Char -> [Char]

display (Node v []) = [v]
display (Node v xs) = '(':v:' ':(concat $ intersperse " " $ map display xs) ++ ")"