FilterRepresents a schema issue produced when a schema filter (refinement check) fails.
When to use
Use when you need to inspect a schema issue that records which refinement check rejected the value.
Details
actualis the raw input value that was tested (plainunknown, not wrapped inOption).filteris the AST filter node that produced this issue.issueis the inner issue describing the failure reason.
Example (Matching a Filter issue)
import { SchemaIssue } from "effect"
function describe(issue: SchemaIssue.Issue): string {
if (issue._tag === "Filter") {
return `Filter failed on: ${JSON.stringify(issue.actual)}`
}
return String(issue)
}export class class Filterclass Filter {
_tag: 'Filter';
actual: unknown;
filter: SchemaAST.Filter<unknown>;
issue: Issue;
toString: (this: Issue) => string;
}
Represents a schema issue produced when a schema filter (refinement check) fails.
When to use
Use when you need to inspect a schema issue that records which refinement
check rejected the value.
Details
actual is the raw input value that was tested (plain unknown, not
wrapped in Option).
filter is the AST filter node that produced this issue.
issue is the inner issue describing the failure reason.
Example (Matching a Filter issue)
import { SchemaIssue } from "effect"
function describe(issue: SchemaIssue.Issue): string {
if (issue._tag === "Filter") {
return `Filter failed on: ${JSON.stringify(issue.actual)}`
}
return String(issue)
}
Filter extends class BaseBase {
readonly Filter._tag: "Filter"_tag = "Filter"
/**
* The input value that caused the issue.
*/
readonly Filter.actual: unknownThe input value that caused the issue.
actual: unknown
/**
* The filter that failed.
*/
readonly Filter.filter: SchemaAST.Filter<unknown>(property) Filter.filter: {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => SchemaAST.Filter<unknown>;
abort: () => SchemaAST.Filter<unknown>;
and: (other: SchemaAST.Check<unknown>, annotations?: Schema.Annotations.Filter) => SchemaAST.FilterGroup<unknown>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
The filter that failed.
filter: import SchemaASTSchemaAST.class Filter<in E>class Filter {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => Filter<E>;
abort: () => Filter<E>;
and: (other: Check<E>, annotations?: Schema.Annotations.Filter) => FilterGroup<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Represents a single validation check attached to an AST node.
Details
run — the validation function. Returns undefined on success, or an
Issue on failure.
annotations — optional filter-level metadata (expected message, meta
tags, arbitrary constraint hints).
aborted — when true, parsing stops immediately after this filter
fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a
FilterGroup
.
Filter<unknown>
/**
* The issue that occurred.
*/
readonly Filter.issue: IssueThe issue that occurred.
issue: type Issue =
| Leaf
| Filter
| Encoding
| Pointer
| Composite
| AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue
constructor(
/**
* The input value that caused the issue.
*/
actual: unknownThe input value that caused the issue.
actual: unknown,
/**
* The filter that failed.
*/
filter: SchemaAST.Filter<any>(parameter) filter: {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => SchemaAST.Filter<any>;
abort: () => SchemaAST.Filter<any>;
and: (other: SchemaAST.Check<any>, annotations?: Schema.Annotations.Filter) => SchemaAST.FilterGroup<any>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
The filter that failed.
filter: import SchemaASTSchemaAST.class Filter<in E>class Filter {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => Filter<E>;
abort: () => Filter<E>;
and: (other: Check<E>, annotations?: Schema.Annotations.Filter) => FilterGroup<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Represents a single validation check attached to an AST node.
Details
run — the validation function. Returns undefined on success, or an
Issue on failure.
annotations — optional filter-level metadata (expected message, meta
tags, arbitrary constraint hints).
aborted — when true, parsing stops immediately after this filter
fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a
FilterGroup
.
Filter<any>,
/**
* The issue that occurred.
*/
issue: IssueThe issue that occurred.
issue: type Issue =
| Leaf
| Filter
| Encoding
| Pointer
| Composite
| AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue
) {
super()
this.Filter.actual: unknownThe input value that caused the issue.
actual = actual: unknownThe input value that caused the issue.
actual
this.Filter.filter: SchemaAST.Filter<unknown>(property) Filter.filter: {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => SchemaAST.Filter<unknown>;
abort: () => SchemaAST.Filter<unknown>;
and: (other: SchemaAST.Check<unknown>, annotations?: Schema.Annotations.Filter) => SchemaAST.FilterGroup<unknown>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
The filter that failed.
filter = filter: SchemaAST.Filter<any>(parameter) filter: {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => SchemaAST.Filter<any>;
abort: () => SchemaAST.Filter<any>;
and: (other: SchemaAST.Check<any>, annotations?: Schema.Annotations.Filter) => SchemaAST.FilterGroup<any>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
The filter that failed.
filter
this.Filter.issue: IssueThe issue that occurred.
issue = issue: IssueThe issue that occurred.
issue
}
}