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

Method constructor

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

Source from the content-addressed store, hash-verified

1139 readonly get: (s: S) => A
1140 readonly set: (a: A) => S
1141 constructor(node: Node, get: (s: S) => A, set: (a: A) => S) {
1142 super(node, (s) => Result.succeed(get(s)), (a) => Result.succeed(set(a)))
1143 this.get = get
1144 this.set = set
1145 }
1146 override replace(a: A, _: S): S {
1147 return this.set(a)
1148 }

Callers

nothing calls this directly

Calls 3

getFunction · 0.70
setFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected