The type system
Bynk makes illegal states unrepresentable: refined and opaque types, sums and
records, and Result/Option errors-as-values, all checked before emission.
Understand
Do
- Define and validate untrusted input
- Decode untrusted JSON into a typed value
- Use a literal where a refined type is expected
- Define sum, record, and opaque types
- Work with
Resultand optional values - Pattern-match with
match - Narrow and bind with
is
See also: Reference — Type system, Refined-type API, Spec §6 — The type system.