MCPcopy Create free account
hub / github.com/effect-app/libs / partial

Function partial

packages/effect-app/src/Option.ts:57–70  ·  view source on GitHub ↗
(
  f: (miss: <X>() => X) => (...args: ARGS) => A
)

Source from the content-addressed store, hash-verified

55 * Simulates a partial function
56 */
57export function partial<ARGS extends any[], A>(
58 f: (miss: <X>() => X) => (...args: ARGS) => A
59): (...args: ARGS) => Option.Option<A> {
60 return (...args) => {
61 try {
62 return Option.some(f(raisePartial)(...args))
63 } catch (e) {
64 if (e instanceof PartialException) {
65 return Option.none()
66 }
67 throw e
68 }
69 }
70}

Callers

nothing calls this directly

Calls 2

someMethod · 0.80
fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…