© 2026 Hedgehog Software, LLC
Messages are not only of type string but can return an Effect so that they can have dependencies (for example, from an internationalization service).
import { Schema } from '@effect/schema'; import { Effect } from 'effect'; Schema.message(() => Effect.gen(function* () { const i18n = yield* I18nContextTag; return i18n.t('message'); }), );
Type Effect<string, never, I18nContextTag> is not assignable to type Effect<string, never, never> Type I18nContextTag is not assignable to type never
export type MessageAnnotation = ( issue: ParseIssue ) => string | Effect<string> | { readonly message: string | Effect<string> readonly override: boolean }