Import
import { fromSchemaEncode } from "@typed/guard";Signatures
export declare function fromSchemaEncode<S extends Schema.Top>(schema: S): Guard<S["Type"], S["Encoded"], Schema.SchemaError, S["EncodingServices"]>;Why
Schema encoding is the reverse direction of decoding and keeps encoding services and SchemaError visible in the Guard type.
Ownership and lifetime
Construction acquires no resources; schema services and any scoped work follow each returned Effect invocation.
Examples
import { fromSchemaEncode } from "@typed/guard"
import { Schema } from "effect"
const encoded = fromSchemaEncode(Schema.NumberFromString)