Fold a Result into a single value by running the matching branch.
Dual API — works data-first or curried for use in pipe.
pipe
pipe( chargeOrder(order), Result.match({ ok: receipt => `Charged ${receipt.amount}`, err: e => `Failed: ${e.code}`, }), ) Copy
pipe( chargeOrder(order), Result.match({ ok: receipt => `Charged ${receipt.amount}`, err: e => `Failed: ${e.code}`, }), )
Fold a Result into a single value by running the matching branch.
Dual API — works data-first or curried for use in
pipe.