Full Pipeline Walkthrough (v1.39.0)
Each step declares a single concrete error type. Bind widens the union by exactly one slot per step — the error surface grows automatically:
// Steps — clean single-error signatures
Result<Order, ValidationError> Validate(CheckoutRequest req) => ...
Result<Order, InventoryError> ReserveInventory(Order order) => ...
Result<Order, PaymentError> ProcessPayment(Order order) => ...
Result<Order, DatabaseError> CreateOrder(Order order) => ...
// Pipeline — union grows: E1 → E1,E2 → E1,E2,E3 → E1,E2,E3,E4
Result<Order, ErrorsOf<ValidationError, InventoryError, PaymentError, DatabaseError>>
Checkout(CheckoutRequest request) =>
Validate(request)
.Bind(ReserveInventory)
.Bind(ProcessPayment)
.Bind(CreateOrder);
// Callsite — exhaustive match, compile-time safe
var result = Checkout(request);
result.Error.Match(
v => HandleValidation(v),
i => HandleInventory(i),
p => HandlePayment(p),
d => HandleDatabase(d));