The success value type.
The union of possible Bad failures (never if none).
Collapse to a single value by handling both arms. Each handler is required
only when its rail is inhabited: an all-success Result<A, never> takes just
{ ok } (and rejects a dead bad), an all-failure Result<never, B> takes
just { bad }.
The bad arm is a per-reason map identical to Result.matchBad — one
callback per failure tag, each receiving the Bad carrying that tag —
so failures refine on their reason without a manual switch.
The success handler's return type.
The bad per-reason handler map (see MatchBadInput).
Whatever the chosen handler returns.
Drop back to the underlying Ok<A> | B leaf union — the inverse of
Result.from. Narrow it with the leaf guards or feed it to the static
toolkit.
The wrapped leaf union.
StaticfromStaticmatchDispatch on a failure's reason tag, like a switch over the Bad
variants. The input must be a Bad (or a union of them): narrow away
any Ok first, with a leaf guard or an earlier return. Passing a value
that could still be an Ok is a compile error at the call site, rather than a
| undefined that leaks into the result.
The Bad (or Bad union) being matched.
The handler map (see MatchBadInput).
The chosen handler's return value.
ResultError if the failure's reason has no handler.
StaticunwrapStaticunwrapStaticunwrapStaticunwrapStaticunwrapLike Result.unwrap, but typed to accept only an Ok.
The success to read.
The Ok value.
ResultError if handed a Bad through an unsafe cast.
An opt-in wrapper around an Ok / Bad leaf that adds chaining combinators (
map,match,toUnion) and hosts the staticunwrap*/ matchBad toolkit. Build it with Result.from — the constructor is private.