Skip to content

match

match<E, A, B>(cases): (data) => B

Defined in: Core/Result.ts:150

Pattern matches on a Result, returning the result of the matching case.

E

A

B

(e) => B

(a) => B

(data): B

Result<E, A>

B

pipe(
  result,
  Result.match({
    ok: value => `Got ${value}`,
    err: error => `Failed: ${error}`
  })
);