onrails
    Preparing search index...
    • 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",
      );
    • 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",
      );