effect-io-ai

Package: effect
Module: Schema

Schema.Schema

A typed view of a schema that tracks only the decoded (output) type T.

Details

Use Schema<T> as a constraint when you want to accept “any schema that decodes to T” and do not need to know or constrain the encoded representation, required services, or any other type parameters.

This is a structural interface — concrete schema values are produced by the constructors in this module (e.g. Struct, String, Number). When you also need the encoded type or service requirements, use Codec.

Example (Accepting any schema decoding to string)

import { Schema } from "effect"

declare function print(schema: Schema.Schema<string>): void

print(Schema.String)            // ok
print(Schema.NonEmptyString)    // ok

See

Signature

export interface Schema<out T> extends Top {
  readonly "Type": T
  readonly "Rebuild": Schema<T>
}

Source

Since v3.10.0