Hyperlinkv0.8.0-beta.28

Schema

Schema.Opticinterfaceeffect/Schema.ts:1024
Optic<T, Iso>

A schema that additionally supports optic (lens/prism) operations.

Details

Optic<T, Iso> extends Schema<T> with an Iso type that describes the isomorphic counterpart used by the optic layer. Crucially, decoding and encoding require no Effect services (DecodingServices and EncodingServices are both never), which means the optic can operate purely without an Effect runtime.

Most primitive schemas (e.g. Schema.String, Schema.Number) implement Optic automatically. You normally interact with this interface through Optic_ utilities rather than constructing it directly.

modelsSchemaOptic_
Source effect/Schema.ts:10246 lines
export interface Optic<out T, out Iso> extends Schema<T> {
  readonly "Iso": Iso
  readonly "DecodingServices": never
  readonly "EncodingServices": never
  readonly "Rebuild": Optic<T, Iso>
}