diff options
Diffstat (limited to 'h7.hs')
-rw-r--r-- | h7.hs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -0,0 +1,5 @@ +data NestedList a = Elem a | List [NestedList a] + +myFlatten :: NestedList a -> [a] +myFlatten (Elem x) = [x] +myFlatten (List x) = concatMap myFlatten x |