Skip to content

match

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

Defined in: Core/TaskOption.ts:111

Pattern matches on a TaskOption, returning a Task of the result.

A

B

() => B

(a) => B

(data): Task<B>

TaskOption<A>

Task<B>

pipe(
  findUser("123"),
  TaskOption.match({
    some: user => `Hello, ${user.name}`,
    none: () => "User not found"
  })
)();