08 / Docs

Start reading.

A tour

Five stops

  1. 01

    Values

    Text, Number, Bool, List<T>, Map<K,V>. let binds, nothing is mutated unless declared var.

  2. 02

    Functions and ?

    fn name(args) -> T declares a total function. fn name(args) -> T? declares one that may abstain.

  3. 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.

  4. 04

    match

    match on a T? has exactly two arms, known and abstain. Leaving one out is a compile error.

  5. 05

    validate

    validate strict on a function checks its result against the declared type before it leaves.