summaryrefslogtreecommitdiff
path: root/1-10/7.hs
blob: 0ebd0301f1eb05e4ef62e7b8374ea0a0ba8ec798 (plain) (blame)
1
2
3
4
data NestedList a = Elem a | List [NestedList a]

flatten (Elem x) = [x]
flatten (List xs) = concat $ map flatten xs