onrails
    Preparing search index...

    Variable matchMaybeConst

    matchMaybe: {
        <T, U>(maybe: Maybe<T>, onSome: (value: T) => U, onNone: () => U): U;
        <T, U>(onSome: (value: T) => U, onNone: () => U): (maybe: Maybe<T>) => U;
    } = match

    Collision-free alias — mirrors matchResult on @onrails/result.

    Type Declaration

      • <T, U>(maybe: Maybe<T>, onSome: (value: T) => U, onNone: () => U): U
      • Terminal collapse — fold both branches into a single value. Positional, dual-form. Same shape as Result.match for sibling consistency.

        For files that also import match from ts-pattern, the alias matchMaybe is identical.

        Type Parameters

        • T
        • U

        Parameters

        • maybe: Maybe<T>
        • onSome: (value: T) => U
        • onNone: () => U

        Returns U

        const greeting = match(
        fromNullable(user),
        (u) => `hello ${u.name}`,
        () => "hello guest",
        );
      • <T, U>(onSome: (value: T) => U, onNone: () => U): (maybe: Maybe<T>) => U
      • Terminal collapse — fold both branches into a single value. Positional, dual-form. Same shape as Result.match for sibling consistency.

        For files that also import match from ts-pattern, the alias matchMaybe is identical.

        Type Parameters

        • T
        • U

        Parameters

        • onSome: (value: T) => U
        • onNone: () => U

        Returns (maybe: Maybe<T>) => U

        const greeting = match(
        fromNullable(user),
        (u) => `hello ${u.name}`,
        () => "hello guest",
        );