Core MUST give errors as values (Result<T, E>, a union of Ok and Err told apart by kind, with ok, err, map, mapErr, andThen, orElse, all, match, unwrapOr, attempt, settle), exhaustive matching (absurd(value: never)) and branded types (Brand<T, B>), one name for each.
Enforced (check): .github: cd commons/core && bun test suite/ — result.test.ts: Result's helpers, absurd with a switch that leaves an alternative out, brands kept apart
Proved by: core/suite/result.test.ts, core/suite/text.test.ts
Written in: core/src/absurd.ts, core/src/brand.ts, core/src/result.ts
Tests: passed: suite/result.test.ts all gives every value in order, or the first failure; passed: suite/result.test.ts map keeps identity and composition (functor laws); passed: suite/result.test.ts ok and andThen are a monad (left identity, right identity, associativity); passed: suite/result.test.ts the types: andThen keeps the error type, and a Result cannot be read without its kind; passed: suite/result.test.ts orElse recovers a failure and leaves a success; unwrapOr, match, attempt and settle and 2 more
Cited by: absurd, brand, Core, result