literals
integers Num 42 → 42
characters Char 'd → 'd
strings Str "hi" → "hi"
floats Num 4.50 → 4.52e3 -> 2000.0
empty list [a] () → []
math
add + Num Num → Num Num Char → Char Char Num → Char 1+2 → 3'a+1 → 'b
sum + [Num] → Num 1,2,3,4+ → 10
sub - Num Num → Num Char Num → Char Num Char → Char Char Char → Num 5-3 → 2'b-'a → 1
mult * Num Num → Num 2*3 → 6
prod * [Num] → Num 1,2,3,4* → 24
div / Num Num → Num 7/3 → 2
mod % Num Num → Num 7%3 → 1
pow ^ Num Num → Num 2^3 → 8
neg - Num → Num 2- → -2
abs | Num → Num 2-| → 22| → 2
floor & Num → Num 1.3& → 1
toBase ; Num Num → [Num] Num Char → Str 6;2 → [0,1,1]
fromBase ; [Num] Num → Num Str Num → Num Str Char → Num 0,1,1;2 → 6
vector
unvec % <a> → [a] 1,2+3% → [4,5]
vectorize . [a] → <a> 1,2,3. → <1,2,3>
range : Num Num → <Num> Char Char → <Char> 3:7 → <3,4,5,6>
from : Num → <Num> Char → <Char> 3: → <3,4,5,6,7,8...
consDefault ^ <a> → <a> [a] → [a] 2,3.^ → <0,2,3>
basic list
head [ [a] → a "abc"[ → 'a
last ] [a] → a "abc"] → 'c
tail > [a] → [a] "abc"> → "bc"
init < [a] → [a] "abc"< → "ab"
len # [a] → Num "asdf"# → 4
take [ [a] Num → [a] Num [a (char)] → [a] "abcd"[3 → "abc"
drop ] [a] Num → [a] Num [a (char)] → [a] "abcd"]3 → "d"
single ; a → [a] 2; → [2]
repeat , a → [a] 2, → [2,2,2,2,2...
concat _ [[a]] → [a] "abc","123"_ → "abc123"
append _ [*a] [*a] → [a] "abc"_"123" → "abc123"
cons ` [*a] *a → [a] 1`2`3 → [3,2,1]
build , *a *a → [a] [*a] *a → [a] *a [*a] → [a] 1,2,3 → [1,2,3]
more list
count = [a] → [Num] "abcaab" = → [0,0,0,1,2,1]
filterFrom ~ <a> [b] → [b] 0,1,1,0 ~ "abcd" → "bc"
sort ! [a] → [a] "atlas" ! → "aalst"
sortFrom ! <a> [b] → [b] 3,1,4 ! "abc" → "bac"
chunk ? [a] → [[a]] "12 3"? → ["12","3"]
chunkFrom ? <a> [b] → [[b]] "11 1" ? "abcd" → ["ab","d"]
transpose \ [[a]] → [[a]] "abc","1"\ → ["a1","b","c"]
reverse / [a] → [a] "abc" / → "cba"
reshape # [a] [Num] → [[a]] [Num] [a (char)] → [[a]] "abcdef"#2 → ["ab","cd","ef"]
string
join * [Str] Str → Str [Num] Str → Str "hi","yo"*" " → "hi yo"
split / Str Str → [Str] "hi, yo"/", " → ["hi","yo"]
replicate ^ Str Num → Str Num Str → Str "ab"^3 → "ababab"
ord & Char → Num 'a& → 97
logic
equalTo = a a → [a] 3=3 → [3]3=0 → []
lessThan < a a → [a] 4<5 → [5]5<4 → []
greaterThan > a a → [a] 5>4 → [4]4>5 → []
not ~ a → Num 2~ → 00~ → 1
and & a b → b 1&2 → 21-&2 → -1
or | *a *a → a 2|0 → 20|2 → 2
"io"
input $ → <Str> all lines of stdin
unmatched } } → <Num> next column from stdin
read ` Str → [Num] "1 2 -3"` → [1,2,-3]
str ` Num → Str 12` → "12"
syntactic sugar
let @ a id → a 5@a+a → 10
push { a → a 5{,1,},2 → [5,1,5,2]
pop } → a 5{,1,},2 → [5,1,5,2]
flip \ op/ 2-\5 → 3
apply @ @op 2*3@+4 → 14
debug
help op see op's info
version see atlas version
type a see expression type
p a pretty print value
print a print value (implicit)
misc
S space Char 1st print separator (overridable)
N '\n Char 2nd print separator (overridable)
unset id Num Roman numeralsMIX → 1009
unset id Char z → 'z
unset id Str Hello → "Hello"

*a coerces
version: Atlas Beta (Dec 15, 2023)