-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new combinator for getting ALL the dependencies of a decl. #4322
Merged
Conversation
This file contains 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
ChrisPenner
requested review from
aryairani
and removed request for
aryairani
September 12, 2023 22:52
ChrisPenner
commented
Sep 12, 2023
ChrisPenner
commented
Sep 13, 2023
|
||
-- | Generate Referents for all possible field accessors of a Decl. | ||
-- Returns 'Nothing' if typechecking of any accessor fails (which shouldn't happen). | ||
hashFieldAccessors :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulled this out of the DeclPrinter and generalized it so we can share.
aryairani
approved these changes
Sep 18, 2023
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.
Overview
Share isn't properly rendering record fields at the moment: https://unisoncomputing.slack.com/archives/CLGTK464E/p1694523701223369
The reason is that Share only pulls in names for things it knows are referenced from what's being pretty-printed,
BUT there's no actual hard-link between a record and its fields, it will only be rendered as a record if all the proper field definitions exist in the pretty-printer.
Some ideas for how I can solve this:
I went with 1 for this approach and it's working 👍🏼
Implementation notes
Add a new method for getting the dependencies of a Decl which includes the field accessors.
I had to add a new module to store this in
parser-typechecker
because we use the typechecker in generating the field accessors.Test coverage
Tested on local enlil
Loose ends
See enlil PR.