Skip to main content
Kira

Standard Library Overview

Kira's standard library is organized into focused modules.

ModuleDescription
std.ioConsole I/O (print, println, read_line)
std.fsFile system (read_file, write_file, exists)
std.listList operations (map, filter, fold, length, reverse)
std.optionOptional value operations
std.resultError handling operations
std.stringString manipulation (split, trim, contains, replace)
std.builderEfficient string building
std.mapHash maps (get, put, contains, new)
std.charCharacter operations
std.mathMathematical operations
std.timeTime operations (now, sleep, elapsed)
std.assertTesting assertions

Built-in Functions

These functions are available without importing:

FunctionDescription
to_string(x)Convert any value to a string
to_int(s)Parse string to integer
to_float(s)Parse string to float
type_of(x)Get the type name of a value
abs(n)Absolute value
min(a, b)Minimum of two values
max(a, b)Maximum of two values
len(x)Length of a collection
assert(cond)Assert a condition is true

Importing

// Import entire module
import std.list

// Import specific items
import std.list.{ map, filter, fold }

// Import with alias
import std.list.{ map as list_map }