Playground
Try Synoema expressions. Evaluated via the interpreter.
Try These
Basics & Arithmetic
Arithmetic
6 * 7
Power
2 ** 10
Sum 1..100
foldl (+) 0 [1..100]
Max
max 42 17
Min
min 42 17
Abs
abs (-42)
Range
[1..10]
Sum builtin
sum [1..100]
Length
length [1..50]
Reverse
reverse [1 2 3 4 5]
Lists & Higher-Order
Map
map (\x -> x * x) [1 2 3 4 5]
Filter
filter odd [1..10]
Fold
foldl (\a b -> a + b) 0 [1 2 3 4 5]
Sort
sort [3 1 4 1 5 9 2 6 5]
Zip
zip [1 2 3] ["a" "b" "c"]
zip_with
zip_with (*) [1 2 3 4 5] [5 4 3 2 1]
Take
take 5 [1..100]
Drop
drop 3 [1 2 3 4 5 6]
Nub
nub [1 2 3 2 1 4 3]
Flatten
flatten [[1 2] [3 4] [5 6]]
Math, Strings & Predicates
sin(π/6)
sin (pi / 6)
cos
cos 0.0
exp
exp 1.0
ln ∘ exp
ln (exp 2.0)
log10
log10 1000.0
Mean
mean [80.0 90.0 70.0 85.0 95.0]
str_len
str_len "Synoema"
show
show 42
any
any odd [2 4 6 7 8]
all
all even [2 4 6 8]