我正在尝试使用 SML 中的流函数编写一个函数来展平流,但我不确定该怎么做。
我的想法:
fun flatten xxs = (case xxs of Null => Null | Cons(x, xs) => S.append(x, flatten(xs)))
然而,这不起作用。谁能帮帮我?