import { some, none, match } from 'fp-ts/Option'
import { pipe } from 'fp-ts/function'
assert.strictEqual(
  pipe(
    some(1),
    match(() => 'a none', a => `a some containing ${a}`)
  ),
  'a some containing 1'
)
assert.strictEqual(
  pipe(
    none,
    match(() => 'a none', a => `a some containing ${a}`)
  ),
  'a none'
)
2.10.0
Takes a (lazy) default value, a function, and an
Optionvalue, if theOptionvalue isNonethe default value is returned, otherwise the function is applied to the value inside theSomeand the result is returned.