-
Notifications
You must be signed in to change notification settings - Fork 2
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
Errors with Natural #99
Comments
So I think I'm including everything, but I'm still getting the same error. I see that you have added support for here is the diff and commit you can try to build from: (NOTE: the github org on that url is no longer |
I’m not too surprised. If you look at the error, you see For a few reasons (which I’m happy to get into) the plugin doesn’t support unlifted types (I need to document that). But most operations on unlifted types have a lifted equivalent. And it’s a matter of catching the operation before it’s been inlined far enough to get down to unlifted types. That PR has the initial work for Re: building Straw, I don’t know why I didn’t try that. I had only tried |
Also in case it helps you can use this binary cache which has all the stuff |
The plugin needs to have the ability to output something similar to a stack trace, which will make it a lot easier to figure out where |
Sorry, this was not fixed by #102 (as discussed above). I just forgot to fix the description of that PR before merging. |
@sellout Just wanted to check in on this one. After thinking about it a little bit, I could also change the underlying representation of |
I don’t think I did manage to replicate the issue locally, and I think I know what needs to change. I can try to make those changes today. In parallel, I also want to write more documentation on how to debug this and how to extend the plugin properly (took long enough to get it back in my head that there clearly needs to be more explanation if anyone else is going to have a chance). |
I didn't try it with raw https://hackage.haskell.org/package/modular-arithmetic-2.0.0.3/docs/Data-Modular.html instantiating which resulted in an even stranger error message
My GHC Core skills aren't strong enough to know exactly what this means, but it seems like it doesn't like the value level witness for some kind of type equality check
FWIW I am using GHC 9.0.2 Thanks for tracking this down, I look forward to whatever solution ends up working. I am also eager to learn more, so it's interesting to me to see these changes coming in :) |
Are you saying that this should JustWork™ (with the |
Well, I think at least this particular problem should go away. I.e., |
What you're saying tracks with my experience. I ripped out all of this type witness nonsense from the
|
I was using to the plug-in, and part of my program involved an
(==)
expression on this type. The plug-in threw the following exception:My understanding from the discord thread is that the expression had been optimized to the underlying
Natural
type by the time it hit the plug-in, and there is apparently no support forNatural
.I guess I either need (1) to add support for
Natural
to the plugin or (2) better understand what classes need to be implemented in order to compile thePrime p
type. It is also a supported object in my target category.You can find the offending program here:
https://github.com/martyall/straw/blob/snarkl-json-update/examples/Examples/Arithmetic.hs#L50-L64
The text was updated successfully, but these errors were encountered: