Standard Library
Prelude
Names available in every Leaf source file without explicit import.
Interfaces
PartialEq[T],Eq[T],Hash,Comparable[T],ToString,Iterator[T],Iterable[T]
Types
- Built-in Enums:
Ordering,Option[T],Result[T, E],GeneratorResult[Y, R],IoError,Generator[Y, R, N] - Tuples
- Built-in Collections:
List[T],Map[K, V],Set[T],Buffer
Functions and Methods
- Built-in Functions:
print,println,readln,panic,toList,toMap,toSet - Interface Conformance Summary
- Primitive Type Methods:
bool,byte,int,uint,float,str
I/O
The io module must be imported explicitly via use @std.io. Provides readFile, writeFile, appendFile, readBytes, and writeBytes.
Environment
The env module must be imported explicitly via use @std.env. Provides args, vars, and exit for accessing command-line arguments, environment variables, and process termination.
Topic Cross-References
- Interfaces: defined here (interfaces.md), implementation rules in lang/structs/core.md (§4.5)
- Enums: built-in enums here (types.md), enum definition in lang/structs/data-types.md (§4.6), pattern matching in lang/types.md (§3.1)
- Collections: API here (types.md), syntax in lang/structs/data-types.md (§4.8), destructuring in lang/semantics/patterns.md (§2.14)
- Tuples: details here (types.md), definition in lang/structs/data-types.md (§4.7)