| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I'm hoping I can find some time to pick this up again soon, but I think what I have here works as a proof of concept, so I'm interested to hear what people think of this approach. Alternatives I can think of:
module Main where
import Data.List as L
x = L.fromFoldable [1,2,3]It would be nice to be able to produce a suggested type signature that says x :: L.List here, so that the user can simply insert that into the source file and have things Just Work; this approach allows us to easily do that. I'm also tempted to get rid of the new field in TypeRenderOptions and instead have the type renderer always print all qualifications that are present, and let the caller strip qualifications if that's what they want. In general I think keeping qualifications is the correct default. |
Sorry, something went wrong.
|
I've not had a chance to look at the meat of this yet, but I'm excited! I did take a stab at this years ago too but my branch got behind master and the diff was too much to deal with. Keeping Imports around to handle names is how the compiler worked in the very early days, and it was a nightmare IMO. I'm interested to look into what you've done here, because my approach to this was just to include more data in Qualified, as per your second suggestion. |
Sorry, something went wrong.
|
I don't know how much the changes to golden test outputs reflect a work-in-progress state of the implementation versus what you're trying to achieve, but a number of them are, if not mistakes, steps backward in my opinion. Broadly:
Provided none of those objections pose difficulties for the approach, the requalification pass makes a lot of sense to me. |
Sorry, something went wrong.
|
Completely agree - this is far from what I’d consider ready. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Will hopefully fix #1647, reported by me a mere 7 years ago. 🤯
The idea is to make a note of the Imports for the current module before type checking, and then if there are any errors, construct a reverse lookup of more or less the same information in the Imports, so that we can go from fully-qualified names back to names that are qualified as they would be in the source file, and then "requalify" any types in error messages according to that reverse lookup.
While this does what we want sometimes (see e.g. the new tests TypeQualification{1,2,3}), it doesn't quite do what we want most of the time, and I think one of the main reasons it's not doing what we want is because of missing cases in onTypesInErrorMessage.
Checklist: