Skip to content

Types & Functions

Every ilo function declares its parameter types and return type inline:

ilo
funcname param1:type param2:type>returntype;body
SigilTypeDescription
nNumberIntegers and floats
tTextStrings
bBooleantrue / false
_AnyWildcard — accepts any type
LListOrdered collection [1 2 3]
MMapKey-value pairs {"key" "val"}
RResultSuccess or error value
OOptionalNil or a value: O n

_ means “don’t care” — same as in match patterns. Use it for mixed-type lists (L _), results where you ignore a type (R _ t), or generic parameters (x:_).

ilo
dbl x:n>n;*x 2 -- number → number
greet first:t last:t>t;cat first " " last -- text params, text return
truthy x:_>b;!!x -- any type, boolean return
pi>n;3.14159 -- zero-arg function

In a file, use newlines and indentation:

ilo
calc a:n b:n > n -- two numbers in, number out
s = + a b -- sum
p = * a b -- product
+ s p -- return sum + product

Inline, use ; instead:

Shell
ilo 'calc a:n b:n>n;s=+a b;p=*a b;+s p' 3 4

Each statement binds a variable or returns a value. The last expression is the return value.