Transform the success value of a Result. Errors short-circuit: if the input is err, fn is not called and the error is propagated unchanged.
err
fn
Dual API — works data-first or curried for use in pipe.
pipe
pipe( ok({ id: "u-1", name: "Alice" }), Result.map(user => user.name.toUpperCase()), ) // { ok: true, value: "ALICE" } Copy
pipe( ok({ id: "u-1", name: "Alice" }), Result.map(user => user.name.toUpperCase()), ) // { ok: true, value: "ALICE" }
Transform the success value of a Result. Errors short-circuit: if the input is
err,fnis not called and the error is propagated unchanged.Dual API — works data-first or curried for use in
pipe.