Optional
Optional<
S,A> =object
Defined in: Core/Optional.ts:28
Focuses on a property or indexed value A inside a parent structure S that may or
may not be present, providing a composable way to safely read, overwrite, and immutably
transform nested nullable data.
Reads return Maybe<A>. Overwriting or modifying returns the original structure
unchanged if the path is broken.
Compose with other Optionals via andThen, or with a Lens via andThenLens.
Example
Section titled “Example”Type Parameters
Section titled “Type Parameters”S
A
Properties
Section titled “Properties”
readonlyget: (structure) =>Maybe<A>
Defined in: Core/Optional.ts:29
Parameters
Section titled “Parameters”structure
Section titled “structure”S
Returns
Section titled “Returns”Maybe<A>
readonlyset: (value) => (structure) =>S
Defined in: Core/Optional.ts:30
Parameters
Section titled “Parameters”A
Returns
Section titled “Returns”(structure) => S