mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Data/Random/Buffer, spec updated
This commit is contained in:
parent
94e4b16267
commit
f08cd8396f
9 changed files with 164 additions and 10 deletions
|
|
@ -79,12 +79,20 @@ public fun flatten (l) {
|
|||
|
||||
fun append (x) {
|
||||
local new = x : {};
|
||||
|
||||
|
||||
curr [0][1] := new;
|
||||
curr [0] := new
|
||||
}
|
||||
|
||||
fun traverse (l) {
|
||||
case l of
|
||||
_ : _ -> iter (traverse, l)
|
||||
| {} -> skip
|
||||
| _ -> append (l)
|
||||
esac
|
||||
}
|
||||
|
||||
iter (fun (x) {iter (append, x)}, l);
|
||||
traverse (l);
|
||||
|
||||
res [1]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue