design: validate fails fast on first error — spec promises full accumulation (Either [ValidationError]) #31

Closed
opened 2026-06-11 15:38:23 +02:00 by yorunikakeru · 0 comments
Owner

Spec README: semantic validation "Накапливает все ошибки сразу: `Either [ValidationError] IR`".

Actual signature: `validate :: UnvalidatedConfiguration -> Either ValidationError ValidatedIR` (src/DSL/Validate.hs:52) — `<|>`/`asum`/`listToMaybe` return the first duplicate, the first intra-conflict, the first inter-conflict. A config with 10 problems takes 10 edit-compile cycles to clean.

Plus the builder layer is fail-fast too (`StateT _ (Either DomainError)`), so even before validate, a bad name aborts at the first occurrence.

Either implement accumulation (Validation/These-style applicative over all checks — duplicates, intra, inter are independent and trivially accumulable) or fix the spec to stop promising it. Accumulating in `validate` is cheap; accumulating DomainErrors in the builder is a bigger redesign and can be a separate decision.

Spec README: semantic validation "Накапливает все ошибки сразу: \`Either [ValidationError] IR\`". Actual signature: \`validate :: UnvalidatedConfiguration -> Either ValidationError ValidatedIR\` (src/DSL/Validate.hs:52) — \`<|>\`/\`asum\`/\`listToMaybe\` return the **first** duplicate, the **first** intra-conflict, the **first** inter-conflict. A config with 10 problems takes 10 edit-compile cycles to clean. Plus the builder layer is fail-fast too (\`StateT _ (Either DomainError)\`), so even before validate, a bad name aborts at the first occurrence. Either implement accumulation (Validation/These-style applicative over all checks — duplicates, intra, inter are independent and trivially accumulable) or fix the spec to stop promising it. Accumulating in \`validate\` is cheap; accumulating DomainErrors in the builder is a bigger redesign and can be a separate decision.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FrogOS/DSL#31
No description provided.