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 |
Effectful
Section titled “Effectful”| 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 |
Details that matter
Section titled “Details that matter”atreturnsnonefor a negative or out-of-range index;sliceclamps to the list bounds.range a bis half-open; whena >= bit is empty.sortis ascending and only for primitive elements.countcounts bytes;split s ""splits into Unicode characters.intandfloatreturnerr "invalid int"/err "invalid float"on bad input.printandeprintadd one newline.showprintsi64in decimal,f64in shortest form (1.0,0.1,1e20), lists as[1 2].
fetch, now, env, json and dict arrive in v0.2.