-
Notifications
You must be signed in to change notification settings - Fork 126
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
Arith type class requiring more than just a base type #265
Comments
Here is a minimal example that gives a similar type error:
And an even more minimal one:
|
The behavior of Now, you could argue that since we have an |
No negative information reasoning is necessary here. We just need to be able to derive |
From the perspective of improving/simplifying constraints on inferred types, I understand why |
The current set of instances are like this:
Note that we don't have a rule that says Also, currently the solver works backward, form the goal to the assumptions, and tries to simplify the goal to known assumptions. Now, of course we could try to do some forward reasoning too (i.e., start from the assumptions and try to reach a goal), but I am not sure how to guide it. When it is just a single step reasoning (as it is in this case), the derivation is obvious, but I am not sure how to guide it beyond that. I anticipate that this is doable, if we are sure that we never want to add |
Wow, that
I.e. |
After a long discussion with @brianhuffman, we decided The reasoning is that arithmetic operators work over arbitrary structures of sequences of bits. For example,
and sequences of sequences of bits:
Allowing statements like
|
Would it break anything to pretend like we have the following overlapping instances, and just prefer the more specific
|
I don't think we can do much about this for the time being, so I'll close it. If one day a good idea comes up, maybe we can revisit this issue. |
Why is
Arith e
not sufficient? This causes problems...The following works, though
Arith e
isn't even required, butArith ([b]e)
andArith ([c]e)
are!The text was updated successfully, but these errors were encountered: