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

Function toRefinement

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

Source from the content-addressed store, hash-verified

455 * @since 2.0.0
456 */
457export const toRefinement = <A, B extends A>(f: (a: A) => Option<B>): (a: A) => a is B => (a: A): a is B => isSome(f(a))
458
459/**
460 * Wraps the first element of an `Iterable` in a `Some`, or returns `None` if

Callers

nothing calls this directly

Calls 2

isSomeFunction · 0.85
fFunction · 0.50

Tested by

no test coverage detected