* Focuses on a key where setting `undefined` **removes** the key from the * struct (or splices the element from an array/tuple). * * **Details** * * - The focus type becomes `A[Key] | undefined`. * - Does **not** work on union types (compile error). * * **Example** (Deleting
(
this: Lens<S, A>,
key: Key,
..._err: ForbidUnion<A, "cannot use `optionalKey` on a union type">
)
| 615 | * { expected: `"b" tag` } |
| 616 | * ) |
| 617 | * |
| 618 | * _b.getResult({ _tag: "b", b: 1 }) // => Result.succeed({ _tag: "b", b: 1 }) |
| 619 | * ``` |
| 620 | * |
no outgoing calls