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

Function toRefinement

packages/effect/src/Option.ts:356–356  ·  view source on GitHub ↗
(f: (a: A) => Option<B>)

Source from the content-addressed store, hash-verified

354 * @since 2.0.0
355 */
356export const toRefinement = <A, B extends A>(f: (a: A) => Option<B>): (a: A) => a is B => (a: A): a is B => isSome(f(a))
357
358/**
359 * Converts an `Iterable` into an `Option`, wrapping the first element if it

Callers

nothing calls this directly

Calls 2

isSomeFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…