Merged
Conversation
JacquesCarette
previously approved these changes
Dec 10, 2025
Owner
JacquesCarette
left a comment
There was a problem hiding this comment.
Again, makes sense to me, but I want @balacij 's review as well.
The merge-base changed after approval.
balacij
reviewed
Dec 12, 2025
Comment on lines
39
to
49
| -- | Convert a noun-phrase structure into a sentence and reuse 'sentenceRefs'. | ||
| npStructRefs :: NPStruct -> Set.Set UID | ||
| npStructRefs = sentenceRefs . npStructToSentence | ||
| {-# INLINABLE npStructRefs #-} | ||
|
|
||
| -- | Translate 'NPStruct' into a 'Sentence' so that sentence helpers can traverse it. | ||
| npStructToSentence :: NPStruct -> Sentence | ||
| npStructToSentence (S s) = Sent.S s | ||
| npStructToSentence (a :-: b) = npStructToSentence a Sent.:+: npStructToSentence b | ||
| npStructToSentence (a :+: b) = npStructToSentence a Sent.+:+ npStructToSentence b | ||
| npStructToSentence (P sym) = Sent.P sym |
Collaborator
There was a problem hiding this comment.
What inside of an NPStruct can contain a UID reference? It looks like it would always be empty, no?
Owner
There was a problem hiding this comment.
Indeed, NPStruct can never contain UIDs.
Collaborator
There was a problem hiding this comment.
In that case, I think we can short-circuit the definition of HasChunkRefs NP to mempty with an explanation of why mempty is appropriate.
Owner
Collaborator
Author
JacquesCarette
approved these changes
Jan 22, 2026
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.
Contributes to #4476 and #4434.
Moved NP data types into
NounPhrase.Typesto remove the old NP ↔ Sentence circular dependency.Added a real
HasChunkRefsinstance for NP using the same logic fromfill-chunk-refs. NP now reports any referenced UIDs.Exported
sentenceRefsso NP (and others later) can reuse the same reference-extraction code.This sets up the next steps where
Reference,NamedIdea, etc. will switch to automaticHasChunkRefs.