Renderingla

Conversion and construction

Two important conversion operators, one for runtime and one for compile-time:

# runtime conversion
fixum _ parsed ← "42" ↦ numerus
# static ascription
fixum numerus value ← 7
fixum _ text ← value ∷ textus

Runtime conversion — ↦

Use for runtime conversion, especially parsing or coercion that may fail. Supply inline recovery with :

fixum textus input ← "9"
fixum _ n ← "42" ↦ numerus
fixum _ safe ← input ↦ numerus ⇥ 0

Type-directed materialization:

fixum textus path ← "/etc/hosts"
fixum _ lanes ← [1.0, 2.0, 3.0, 4.0] ↦ vf32[4]
fixum _ body ← ad 'solum:lege' (path) ↦ textus

Static ascription — ∷

Use for explicit static type ascription. It is postfix and target-type driven:

fixum numerus value ← 7
fixum _ x ← 7 ∷ numerus<i32>
fixum _ text ← value ∷ textus

Nullish coalescing — vel

Use vel for nullish coalescing when a value is nihil:

fixum textus ∪ nihil provided_name ← nihil
fixum _ name ← provided_name vel "default"