Backup commit before crunch

This commit is contained in:
2023-05-16 18:32:25 +01:00
parent 33413b2b0f
commit 126494c63f
59 changed files with 847 additions and 236 deletions

View File

@@ -0,0 +1,26 @@
import std::(to_string, print)
import super::list
import fn::*
export main := do{
let foo = list::new[1, 2, 3, 4, 5, 6];
let bar = list::map foo n => n * 2;
let sum = bar
|> list::skip 2
|> list::take 3
|> list::reduce 0 (a b) => a + b;
cps print $ to_string sum ++ "\n";
0
}
--[
export main := do{
let n = 1;
let acc = 1;
loop r on (n acc) with (
if n == 5
then print acc
else r (n + 1) (acc * 2)
)
}
]--