Skip to content
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

buildDictionaryT and free type variables? #170

Open
conal opened this issue Feb 1, 2016 · 1 comment
Open

buildDictionaryT and free type variables? #170

conal opened this issue Feb 1, 2016 · 1 comment

Comments

@conal
Copy link
Contributor

conal commented Feb 1, 2016

Is there an issue with buildDictionaryT and types with free type variables? I had an old guardMsg in my code that uses buildDictionaryT to avoid free type variables (failing when they're present). I now need to build dictionaries even when there are free variables (assuming there's enough known structure to determine an instance), in order to support separate compilation usefully. I'm getting success where I shouldn't, however, and lintExprR is reporting errors like the following:

In the expression: $fNumCat:>a
                     @ a $dNum $dRead $dShow $dEq $dGenBuses $dSourceToBuses
$dNum :: Num a is out of scope

There is a bound type variable a in scope, but perhaps it has a different unique. Moreover, there isn't really enough type information to satisfy these superclass constraints other than Num.

For now, I'm adding a lintExprR call after each buildDictionaryT call, so I'm okay for now, but I'd rather find a cheaper solution.

I'm happy to learn more about the mechanics underlying buildDictionaryT and try sleuthing this one out myself, and I do have a workaround, so no rush on this issue. At this point, I'd appreciate a reminder of the status, and any insights, tips, etc.

@conal
Copy link
Contributor Author

conal commented Feb 2, 2016

BTW, I just stumbled onto ghc-tcplugins-extra, as used in Iavor's type-nat-solver. Might be useful with HERMIT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant