Skip to content

Builtins

Generated from the compiler’s builtin table (aleph llms). T, A, B are type variables; (A->B) is a function value passed with @f.

Name Signature
args ()->list str
at list T,i64->opt T
cat str,str->str
contains str,str->bool
count str->i64
filter (A->bool),list A->list A
float str->res f64 str
fold (B,A->B),B,list A->B
int str->res i64 str
join list str,str->str
len list T->i64
lower str->str
map (A->B),list A->list B
push list T,T->list T
range i64,i64->list i64
rev list T->list T
show T->str (T primitive or list of primitive)
slice list T,i64,i64->list T
sort list T->list T (T primitive)
split str,str->list str
sum list i64->i64
trim str->str
upper str->str
Name Signature Capability
eprint str->unit none
print str->unit none
read str->res str str fs.read
write str,str->res unit str fs.write
  • at returns none for a negative or out-of-range index; slice clamps to the list bounds.
  • range a b is half-open; when a >= b it is empty.
  • sort is ascending and only for primitive elements.
  • count counts bytes; split s "" splits into Unicode characters.
  • int and float return err "invalid int" / err "invalid float" on bad input.
  • print and eprint add one newline.
  • show prints i64 in decimal, f64 in shortest form (1.0, 0.1, 1e20), lists as [1 2].

fetch, now, env, json and dict arrive in v0.2.