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

Method constructor

packages/effect/src/Optic.ts:1126–1130  ·  view source on GitHub ↗
(node: Node, get: (s: S) => A, set: (a: A) => S)

Source from the content-addressed store, hash-verified

1124 readonly get: (s: S) => A
1125 readonly set: (a: A) => S
1126 constructor(node: Node, get: (s: S) => A, set: (a: A) => S) {
1127 super(node, (s) => Result.succeed(get(s)), (a) => Result.succeed(set(a)))
1128 this.get = get
1129 this.set = set
1130 }
1131 override replace(a: A, _: S): S {
1132 return this.set(a)
1133 }

Callers

nothing calls this directly

Calls 3

getFunction · 0.70
setFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected