📄️ Result<T, E>
Result is a discriminated union of Ok and Err. It represents an operation that can succeed with a value of type T or fail with an error of type E. This is the same concept as Rust's std::Result.
📄️ ResultAsync<T, E>
ResultAsync wraps a Promise> and provides the same chainable API as Result, but all operations are async-aware. It implements PromiseLike>, so you can await it directly.
📄️ Composing with chain()
chain() provides generator-based composition for Result operations — similar to Rust's ? operator. Inside a generator, yield* unwraps an Ok value or short-circuits on Err, giving you a linear, readable flow.
📄️ Modeling Errors
With exceptions, errors are unknown. With Result, you choose E — making errors visible, typed, and exhaustively matchable. This page covers patterns for designing error types.