Skip to content

toOptional

toOptional<S, A>(lens): Optional<S, A>

Defined in: Core/Lens.ts:130

Converts a Lens to an Optional. Every Lens is a valid Optional whose get always returns Some.

S

A

Lens<S, A>

Optional<S, A>

pipe(
  Lens.from.property<User>()("address"),
  Lens.toOptional,
  Optional.andThen(Optional.from.property<Address>()("landmark")),
);