Improves the error while reducing type family and encountering invisible param
- rGHC Glasgow Haskell Compiler
No Unit Test Coverage
- Build Status
Buildable 23174 Build 54904: [GHC] Linux/amd64: Continuous Integration Build 54903: [GHC] OSX/amd64: Continuous Integration Build 54902: [GHC] Windows/amd64: Continuous Integration Build 54901: arc lint + arc unit
If I got this right then the next step is to connect the dots to the mkExpectedActualMsg which seems to be where the error is printed. This step is what I am stuck on currently.
I like the way you've made a new datatype to capture the result of reduceTyFamApp, but I think you will need to modify the code in the Unify module to really get this right. The approach you're taking here around invisible arguments does not look like it will work out. Thanks for posting this and starting work here!
Why change to Either? It doesn't look like the Left value is ever used.
Good to make a new datatype around this.
Though this is a nitpick, I don't love the word "error" as used around here. There's no error -- it's just a type family that doesn't reduce (yet). "Stuck" maybe?
1-indexed or 0-indexed? 1 is probably better, but the comment should say.
I don't think you meant to add this line.
There should be a comment on TyFamAppErr explaining that 0 means something else strange happened. But I wonder if this code shouldn't be replaced by a panic -- I don't think this would ever happen.
This looks like it blames the first invisible argument, regardless of the type family and its arguments. Why isn't the problem a visible argument? Why is it the first invisible one?
|1414 ↗||(On Diff #17228)|
This won't work in general, because an invisible argument might be the same as a visible one.