Esc

span_check

procedureextensionsince 0.36.1Source
  • macOS: span_check works on macOS
  • Linux: span_check works on Linux
  • Windows: span_check works on Windows
  • Wasm: span_check works on Wasm

Validates the single-sign invariant without balancing units.

Signature

span_check :: (value: Span) -> (Span, Time_Error)
Example↗
ok, error := span_check(.{ months = 1, days = 2 });
assert(error.kind == .NONE && ok.days == 2);
_, mixed := span_check(.{ years = 1, days = -1 });
assert(mixed.kind == .INVALID_VALUE);

See also