MCPcopy Create free account
hub / github.com/effect-app/libs / modify

Method modify

repos/effect/packages/effect/src/Optic.ts:559–559  ·  view source on GitHub ↗

* Returns a function `(s: S) => S` that applies `f` to the focused value. * If the optic cannot focus, the original `s` is returned unchanged. * * **Example** (Incrementing a nested field) * * ```ts * import { Optic } from "effect" * * type S = { readonly a: { readonly b: num

(f: (a: A) => A)

Source from the content-addressed store, hash-verified

557 this: Lens<S, A>,
558 key: Key,
559 ..._err: ForbidUnion<A, "cannot use `optionalKey` on a union type">
560 ): Lens<S, A[Key] | undefined>
561 optionalKey<S, A extends object, Key extends keyof A>(
562 this: Optional<S, A>,

Callers 15

Array.tst.tsFile · 0.65
Record.test.tsFile · 0.65
Chunk.test.tsFile · 0.65
Optic.test.tsFile · 0.65
Effect.test.tsFile · 0.65
Ref.test.tsFile · 0.65
TxChunk.test.tsFile · 0.65
HashMap.test.tsFile · 0.65
TxHashMap.test.tsFile · 0.65
Array.test.tsFile · 0.65

Implementers 1

OptionalImplrepos/effect/packages/effect/src/Optic

Calls

no outgoing calls

Tested by 2

testLayerFunction · 0.52
fFunction · 0.52