plainfp - v0.1.0
    Preparing search index...

    Function match

    • Fold an Option by supplying a handler for each case. Supports data-first and curried (pipe-friendly) forms.

      Type Parameters

      • T
      • U

      Parameters

      Returns U

      const label = pipe(
      fromNullable(order.shippedAt),
      match({
      some: (date) => `Shipped ${date.toDateString()}`,
      none: () => "Pending",
      }),
      )
    • Fold an Option by supplying a handler for each case. Supports data-first and curried (pipe-friendly) forms.

      Type Parameters

      • T
      • U

      Parameters

      Returns (option: OptionType<T>) => U

      const label = pipe(
      fromNullable(order.shippedAt),
      match({
      some: (date) => `Shipped ${date.toDateString()}`,
      none: () => "Pending",
      }),
      )