* 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)
| 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>, |
no outgoing calls