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

Method modify

packages/effect/src/Optic.ts:501–501  ·  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.meta.vitest * import { Optic } from "effect" * * type S = { readonly a

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

Source from the content-addressed store, hash-verified

499 * ```
500 */
501 modify(f: (a: A) => A): (s: S) => S
502
503 /**
504 * Focuses on a property of the current struct/tuple focus.

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

OptionalImplpackages/effect/src/Optic.ts

Calls

no outgoing calls

Tested by 2

testLayerFunction · 0.52
fFunction · 0.52