Terminal collapse — fold both branches into a single value. Positional, dual-form. Same shape as Result.match for sibling consistency.
Result.match
For files that also import match from ts-pattern, the alias matchMaybe is identical.
match
ts-pattern
const greeting = match( fromNullable(user), (u) => `hello ${u.name}`, () => "hello guest",); Copy
const greeting = match( fromNullable(user), (u) => `hello ${u.name}`, () => "hello guest",);
Terminal collapse — fold both branches into a single value. Positional, dual-form. Same shape as
Result.matchfor sibling consistency.For files that also import
matchfromts-pattern, the alias matchMaybe is identical.