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

Method constructor

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

Source from the content-addressed store, hash-verified

1151class PrismImpl<S, A> extends OptionalImpl<S, A> implements Prism<S, A> {
1152 readonly set: (a: A) => S
1153 constructor(node: Node, getResult: (s: S) => Result.Result<A, SchemaIssue.Issue>, set: (a: A) => S) {
1154 super(node, getResult, (a, _) => Result.succeed(set(a)))
1155 this.set = set
1156 }
1157 override replace(a: A, _: S): S {
1158 return this.set(a)
1159 }

Callers

nothing calls this directly

Calls 2

setFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected