diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-01-31 21:17:58 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-01-31 21:17:58 +0800 |
commit | ae71c88c2e410a3c23387d9c393bf2d02a454bdf (patch) | |
tree | 256fc43e68cc8055ada56550e02edc9df7223c60 | |
parent | d7a259acf6ff7cdda231b489b3707d8948b6507c (diff) | |
download | h99-ae71c88c2e410a3c23387d9c393bf2d02a454bdf.tar.gz h99-ae71c88c2e410a3c23387d9c393bf2d02a454bdf.tar.bz2 h99-ae71c88c2e410a3c23387d9c393bf2d02a454bdf.zip |
p7
-rw-r--r-- | p7.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 |