forked from Orchid/orchid
backup commit of notes so far
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import prelude::*
|
||||
import std::(parse_float, to_string)
|
||||
import std::(readline, print)
|
||||
import std::(readline, print, debug)
|
||||
import std::(concatenate)
|
||||
import super::list
|
||||
import fn::*
|
||||
|
||||
export main := do{
|
||||
--[ export main := do{
|
||||
cps data = readline;
|
||||
let a = parse_float data;
|
||||
cps op = readline;
|
||||
@@ -19,6 +20,35 @@ export main := do{
|
||||
);
|
||||
cps print (to_string result ++ "\n");
|
||||
0
|
||||
} ]--
|
||||
|
||||
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 := 1 do { 1 ; 2 } 3
|
||||
--[
|
||||
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)
|
||||
)
|
||||
}
|
||||
]--
|
||||
--[
|
||||
export main := do{
|
||||
let n = 1;
|
||||
loop r on (n) with (
|
||||
debug r
|
||||
)
|
||||
}
|
||||
]--
|
||||
Reference in New Issue
Block a user