MCPcopy
hub / github.com/Effect-TS/effect / fromOption

Function fromOption

packages/effect/src/Micro.ts:993–994  ·  view source on GitHub ↗
(option: Option.Option<A>)

Source from the content-addressed store, hash-verified

991 * @category constructors
992 */
993export const fromOption = <A>(option: Option.Option<A>): Micro<A, NoSuchElementException> =>
994 option._tag === "Some" ? succeed(option.value) : fail(new NoSuchElementException({}))
995
996/**
997 * Converts an `Either` into a `Micro` effect, that will fail with the left side

Callers 1

liftOptionFunction · 0.70

Calls 2

failFunction · 0.70
succeedFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…