summaryrefslogtreecommitdiff
path: root/p7.hs
blob: c67b5c5ca0ae1537dc2edb1b298ef6248122f8a7 (plain)
1
2
3
4
5
data NestedList a = Elem a | List [NestedList a]

myFlatten :: NestedList a -> [a]
myFlatten (Elem x) = [x]
myFlatten (List x) = concatMap myFlatten x