Hyperlinkv0.8.0-beta.28

Schema

Schema.toIsofunctioneffect/Schema.ts:13970
<S extends Constraint>(schema: S): Optic_.Iso<S["Type"], S["Iso"]>

Derives an Iso optic from a schema that isomorphically converts between the schema's Type and its Iso (intermediate / serialized form).

Optic
export function toIso<S extends Constraint>(schema: S): Optic_.Iso<S["Type"], S["Iso"]> {
  const serializer = toCodecIso(schema)
  return Optic_.makeIso(SchemaParser.encodeSync(serializer), SchemaParser.decodeSync(serializer))
}