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

Function makePrism

packages/effect/src/Optic.ts:266–271  ·  view source on GitHub ↗
(
  getResult: (s: S) => Result.Result<A, SchemaIssue.Issue>,
  set: (a: A) => S
)

Source from the content-addressed store, hash-verified

264 * @since 4.0.0
265 */
266export function makePrism<S, A>(
267 getResult: (s: S) => Result.Result<A, SchemaIssue.Issue>,
268 set: (a: A) => S
269): Prism<S, A> {
270 return make(primitiveNode("Prism", getResult, set))
271}
272
273/**
274 * Creates a {@link Prism} from one or more `Schema` validation checks.

Callers 4

someFunction · 0.85
noneFunction · 0.85
successFunction · 0.85
failureFunction · 0.85

Calls 2

primitiveNodeFunction · 0.85
makeFunction · 0.70

Tested by

no test coverage detected