Scarlet Industries

Modules

Every file is a module.

Exports

pub exports a definition; pub opaque type exports a type and keeps its constructors private. A doc block on line 0 documents the module.

Imports

import scarlet/array
import ./lib/report/table
import ./lib/units as units
import ./lib/units.{ABSOLUTE_ZERO_C, Celsius, celsius as c}
import ./color.{Green as G}

A path that starts with ./ or ../ is relative to the importing file's directory, never to the directory the program was run from. A path without a leading marker names a standard library module. Selective imports pull types, constructors, constants, and functions, and rename with as. match c { G(s) -> s } is a Green arm.