Repository navigation
refactor(dfns): derive tagged on keywords, records and unions - #390
Merged
Merged
Conversation
`tagged` now means "begins with a keyword" on every field. A scalar or array still declares it: whether its own name precedes its value. Other types derive it, as a list already did. A keyword is always tagged, a record is tagged if its first field is, and a union if every arm is, which is a tagged union in the type-theory sense. Records and unions used to default to `tagged = true` whatever their contents, and nothing read the flag on them. 153 records and LAK's `laksetting` (whose arms lead with a lake or outlet number) said tagged but don't begin with a keyword. The derived values match what the renderer and the list and block rules already did, so no behavior changes. The flag is no longer serialized on these types. Files that declare it still load, and a value that contradicts the type is an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reinterpret
taggedto mean "begins with a keyword" on every field. Scalars/arrays still declare it, signaling whether their name precedes their value. A keyword is always tagged. Composite types derive it, as a list already did. A list is tagged if its item is, a record is tagged if its first field is, and a union if every arm is, which is a tagged union in the type-theory sense.