Overview
Core abstractions and types
This page gives a high-level overview of core standard library abstractions.
Modules in this section
- io — console and stream-style input/output helpers
- collections — list and collection transforms
- string — UTF-8 string utilities
- option — optional-value helpers
- result — success/error composition helpers
- math — numeric utilities
- sequence — lazy/iterable sequence helpers
- iter — generic
Iter(a)-based helpers
Core abstractions
seq(a)for finite sequencesgen(a)for potentially infinite sequenceslist(a)for indexed listsset(a)for membership checksmap(k, v)for key/value lookuplookup(k, v)for multi-value lookups
Async collections
stream(a)for async streamsasync(a)for async computations
Option and result
There is no Option type. Any union containing #some(a) is option-like by convention, and the option module’s helpers work on all of them; #some(a) | #none is simply the most common shape.
The Result alias exists for the equally common success/error shape:
type Result(a, e) = #some(a) | #error(e)
Map literals
Maps are written with the square-bracket literal syntax and the => operator:
def myMap = ["hello" => "world", "foo" => "bar"]
Square-bracket literals desugar to a call to the target type’s builder, which is what makes the same syntax work for lists, sets and maps. See Collections.
If you want more detail, visit the specific module pages in this section.