Typed rules#4983
Open
vidit-od wants to merge 7 commits into
Open
Conversation
vidit-od
commented
Jun 20, 2026
Comment on lines
+39
to
+46
| -- | Construct an InputPath without checking whether the path belongs to the | ||
| -- requested input class. | ||
| -- | ||
| -- This is only for trusted internals that are rehydrating already-typed rule | ||
| -- keys from the Shake database. Normal call sites should use the smart | ||
| -- constructors below. | ||
| unsafeMkInputPath :: NormalizedFilePath -> InputPath i | ||
| unsafeMkInputPath = InputPath |
Collaborator
Author
There was a problem hiding this comment.
This is only used in Shakes.
ideally we should make it visible to only Shakes !!
Plugins should not have access to this.
02d2a9e to
9014326
Compare
wz1000
reviewed
Jun 23, 2026
| type family RuleResult key -- = value | ||
|
|
||
| -- | The broad class of input paths a rule is allowed to run on | ||
| data InputClass |
Collaborator
There was a problem hiding this comment.
Let's keep this in ghcide and out of hls-graph if possible
wz1000
reviewed
Jun 23, 2026
|
|
||
| -- | Returns True if the file exists | ||
| getFileExists :: NormalizedFilePath -> Action Bool | ||
| getFileExists :: InputPath AllHaskellFiles -> Action Bool |
Collaborator
There was a problem hiding this comment.
rules like filecontents, file existence, file modification time should probably work for all files, not just haskell files.
wz1000
reviewed
Jun 23, 2026
|
|
||
| -- | The sentinel input for rules that do not operate on a real file. | ||
| toNoFileInput :: InputPath NoFile | ||
| toNoFileInput = InputPath emptyFilePath |
Collaborator
There was a problem hiding this comment.
While we are in the area, can we figure out a way to get rid of this hack and not have emptyFilePath here?
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.
This PR contains work for Part-1 for Goto dependency definition, part of GSoC' 26.
Aims to introduce Typed Rules. This will allow us to selectively make sure which rules can be triggered on Dependency files.
Essentially helps prevent triggering of Type-checking on Dependency files
Credits :
Borrows from Pr #4449 by @nlander
Mentors : @fendor and @wz1000
Parent PR : #4973 ( This is a cherry-picked subsection of parent )
Thank you !