Canonical bind (Fantasy Land chain). Chains a Result-returning step, widening the error union to E | F. Short-circuits on Err.
chain
E | F
Err
flatMap(parseInput(raw), (data) => data.id != null ? ok(data) : err({ kind: "missing_id" as const }),);// Result<Data, ParseError | { kind: "missing_id" }> Copy
flatMap(parseInput(raw), (data) => data.id != null ? ok(data) : err({ kind: "missing_id" as const }),);// Result<Data, ParseError | { kind: "missing_id" }>
Canonical bind (Fantasy Land
chain). Chains a Result-returning step, widening the error union toE | F. Short-circuits onErr.