Something went wrong. Try again.
A component based functional template language
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263template Component { let max = fn (a, b) -> { guard (a > b) else b; a };
let min = fn (a, b) -> { if (a < b) { a } else { b } };
let until = 5; let map = fn (array, f) -> { for (el in array) { if (min(el, until) == until) continue;
f(el) } };
let add_curry = fn (a) -> { fn (b) -> { a + b } };
let is_even = fn (i) -> { guard(i != 0) else true; is_odd(i - 1) } and is_odd = fn (i) -> { guard (i != 0) else false;
is_even(i - 1) };
<section> max(1, 5) = {max(1, 5)} min(1, 5) = {min(1, 5)} add_curry(1)(5) = {add_curry(1)(5)} Math.fibonacci(9) = {Math.fibonacci(9)} Math.factorial(5) = {Math.factorial(5)} is_even(10) = {is_even(10)} is_odd(10) = {is_odd(10)}
1 |> max(5) |> Math.factorial = {1 |> max(5) |> Math.factorial} 1 |> add_curry(5)() = {1 |> add_curry(5)()} 5 |> Math.factorial = {5 |> Math.factorial}
Math__Constants.pi = {Math__Constants.pi}
Map: {map(1...10, fn (item) -> item ** 2)} Map Pipe: {1...10 |> map(fn (item) -> item ** 2)} </section>}