-
Notifications
You must be signed in to change notification settings - Fork 50
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
Orphans in hidden packages #81
Comments
I probably added that filtering because something visibly broke without it. GHC is a complicated beast, and it's been a few years now, and so I'm afraid I don't remember my motivation. How did you come upon this question? |
We use the concat plugin at Kitty Hawk and I noticed that it doesn't always find the orphan instances. I tried removing the filter and got errors like
So I guess that's the reason for having it, but I wonder if there's a better solution (like somehow making GHC suppress this error). |
Thanks for the additional context. That error message certainly rings a bell for me! I’m afraid that my plugin is using GHC in ways its authors didn’t anticipate. Although the GHC API is several years old now, it’s still much younger than GHC itself, and so there are probably contradictions between the implementation’s assumptions and the offered flexibility of the API. I vaguely remember struggling with orphan instances, including some GHC calls or parameters especially for those instances. Hopefully the flexibility is there but I simply didn’t exercise it correctly. I encourage you to give it a try if you have the needed combination of will, stamina, and know-how. (Luck may help, too.) |
buildDictionary
filters out orphans from hidden modules:That means if
A
importsB
,B
importsC
, andC
is in a hidden package when compilingA
, then I don't think the orphan instances inC
will be found bybuildDictionary
, even thoughC
is transitively imported byA
.I think GHC does consider such orphan instances when resolving type class constraints. I wonder if what
buildDictionary
does is a deliberate design choice?The text was updated successfully, but these errors were encountered: