No built-in tag constructors: Date, binary Data, and Set don't auto-decode #11
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status (2026-07-10)
Open. Found by a public-API feature-parity audit against Yams
(NodetteHQ/PureYAMLYamsComparison,
Reports/macos-2026-07-10-apisguru-sample-504/FEATURE-PARITY.md),not by a corpus parse-success run: this is a capability gap, not a
correctness bug.
Yams has a
Resolver(regex-pattern rules resolving a scalar's implicittag) and a
Constructor(a tag-to-closure map used to turn a tagged nodeinto a Swift value), with built-in handlers for
Date, binaryData(base64),
Set, and ordered maps. A caller gets these for free; customresolvers/constructors extend rather than replace them.
PureYAML has a narrower, opt-in-only version:
Tagged.Constructor<Output>(
Sources/Tagged/Tagged.Constructor.swift) lets a caller register exact-taghandlers with an explicit fallback, on the separate
Tagged.Nodetree fromparseTagged(_:)(not the primaryparse(_:)/Model.Valuepath). It shipswith zero built-in constructors by design — confirmed explicitly in
docs/MIGRATION.md: "Custom resolvers and environment expansion: Notimplemented." There is no regex-based implicit-tag resolver equivalent to
Yams's
Resolverat all.Impact
A document using YAML's standard timestamp or binary tags (
!!timestamp,!!binary) requires the caller to write and register their ownTagged.Constructorhandlers to get typedDate/Datavalues out; withYams this happens automatically. Anyone porting code that relies on Yams's
default decoding of these needs new code, not just a dependency swap.
Work
!!timestamptoDateand!!binarytoDatalook like the two most likely to matter in practice,matching Yams's defaults;
!!setand ordered-map handling may be lowerpriority since PureYAML's
Model.Mappingalready preserves order andduplicate keys without a special tag.
Tagged.Constructor, or as a new built-in path integrated withparse(_:)/Model.Valuedirectly (the latter would need a way torepresent a
Date/Datavalue inModel.Value, which does not existtoday, so likely needs scoping against the
Model.Valuecase set first).!!timestampscalar, get a
Date, dump it back to the same tagged form).See NodetteHQ/PureYAMLYamsComparison's
FEATURE-PARITY.mdfor the fullaudit.
Part of #8.