MCPcopy Create free account
hub / github.com/Effect-TS/effect / some

Function some

packages/effect/src/Optic.ts:1433–1439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1431 * @since 4.0.0
1432 */
1433export function some<A>(): Prism<Option.Option<A>, A> {
1434 const run = runRefinement(Option.isSome, { expected: "a Some value" })
1435 return makePrism(
1436 (s) => Result.map(run(s), (s) => s.value),
1437 Option.some
1438 )
1439}
1440
1441/**
1442 * Prism that focuses on `Option.None`, exposing `undefined`.

Callers

nothing calls this directly

Calls 4

runRefinementFunction · 0.85
makePrismFunction · 0.85
runFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected