08 / Docs
Start reading.
A tour
Five stops
- 01
Values
Text, Number, Bool, List<T>, Map<K,V>. let binds, nothing is mutated unless declared var.
- 02
Functions and ?
fn name(args) -> T declares a total function. fn name(args) -> T? declares one that may abstain.
- 03
know … else
know looks something up. If it is present the arm runs with it bound; otherwise the else arm must return a value or abstain.
- 04
match
match on a T? has exactly two arms, known and abstain. Leaving one out is a compile error.
- 05
validate
validate strict on a function checks its result against the declared type before it leaves.