shorthand for mapping over tagged union schema
I maintainer di solito rispondono entro 1 giorno
@effect-bot ci sta già lavorando.
Dal 2/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What is the problem this feature would solve?
A more concise way to express cases such as the following:
import { Record, Schema as S, Tuple } from "effect"
import { ModuleSpecifier, RecoveryInstruction } from "../schema/index.ts"
import { DiagnosticOrigin } from "./DiagnosticOrigin.ts"
/** A diagnostic for an observed extension failure; interruption is cancellation and creates no extension diagnostic. */
export type Diagnostic = typeof Diagnostic.Type
export const Diagnostic = S.TaggedUnion({
Error: {
/** Safe, normalized failure details when remediation is unknown; excludes raw error objects and source excerpts. */
error: S.NonEmptyString.check(S.isPattern(/\S/u)).annotate({
description:
"Safe, normalized failure details when remediation is unknown; excludes raw error objects and source excerpts."
})
},
Instruction: {
/** Actionable remediation including relevant failure context, replacing standalone error details. */
instruction: RecoveryInstruction.annotateKey({
description: "Actionable remediation including relevant failure context, replacing standalone error details."
})
}
})
.pipe((schema) => S.Union(Record.values(schema.cases)))
.mapMembers(
Tuple.map(
S.fieldsAssign({
/** The configured segmenter or enrichment module that failed. */
module: ModuleSpecifier.annotateKey({
description: "The configured segmenter or enrichment module that failed."
}),
/** The extension kind and lifecycle stage: setup origins have no location, segmenter execution references a supplied change, and enrichment execution references a trait-local input. */
origin: DiagnosticOrigin
})
)
)
.annotate({
description:
"A diagnostic for an observed extension failure; interruption is cancellation and creates no extension diagnostic."
})
.pipe(S.toTaggedUnion("_tag"))
What is the feature you are proposing to solve the problem?
Not sure what the exact API would look like––but ideally one wouldn't need to turn the initial tagged union schema into a union schema (in order to map its members) and then turn it back into a tagged union schema.
What alternatives have you considered?
No response
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 808
- Merge medio
- 11h 3m
- PR unite (30g)
- 840
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Effect-TS/effect
-
PgClient: withTransaction dies instead of failing with SqlError when the server ends the sessionForse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#10290 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Cluster: A way to remove processed requests from storageForse già presa @effect-bot l’ha presa 2 giorni fa. Apertaenhancement
Effect-TS/effect#10239 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
cluster: a runner that lost its shard lock can still write replies and messages for that shardAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 47/100
I maintainer di solito rispondono entro 1 giorno
-
`fromJsonSchemaDocument`: import open `patternProperties`Forse già presa @effect-bot l’ha presa 5 giorni fa. Aperta
Effect-TS/effect#10048 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
area: cli bug flake ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
gazetta-studio/gazetta-studio#1772 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/playwright#43875 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
calagopus/panel#285 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno