99 道厄姆难题/第 7 题/答案
外观
解答 1:递归版本
flatten list =
case list of
Elem e -> [ e ]
NestedList [] -> []
NestedList (head :: tail) -> flatten head ++ flatten (NestedList tail)
解答 1:递归版本
flatten list =
case list of
Elem e -> [ e ]
NestedList [] -> []
NestedList (head :: tail) -> flatten head ++ flatten (NestedList tail)