-
Notifications
You must be signed in to change notification settings - Fork 51
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
Clarifying Valid Types #298
Comments
That doesn't sound right: I use That seems right besides that. |
Thanks @oflatt for the clarification. I realized I am a little fuzzy on how adding a default or merge function changes the non-primitive sorts. My current understanding of So I am unclear what the If I try out this example:
It looks like the difference is that Taking a look at the code, this example is desugared as:
If we add a
The So the semantics seem to be:
|
Yes, I thought we disallowed using |
So this means that if you define a It makes me wonder if it's necessary to keep separate
I think it was disallowed, but there was a leftover code path for when it was still there I was looking at. I just submitted a PR to remove that unused code #307 |
Hmm, if you use |
No there is no type error for a rewrite with a custom merge function, it will just call the union which will ignore the merge function:
|
Okay, that's bad. |
It also doesn't really make sense to have a |
I'll try to come up with an RFC to solve this conundrum |
Thanks! Yeah it's definitely a bit idiosyncratic at the moment. If you want someone to bounce ideas off of happy to jump on a call too. |
I noticed that the lambda example uses |
Created #309, let me know what you think! |
Thanks, @oflatt, for all the clarifications on what's valid currently! Compared to the initial post I have realized that:
I'll close this since the questions this issue raised have been resolved. They have brought to light some potential points of confusion around the existing implementation, but I will leave that to another issue to discuss if necessary. |
I am looking to see if I can tighten the static analysis type in the Python bindings and wanted to get some feedback on my current understanding of what is allowed:
union
: Must be user-defined sortsset
: Must be primitive sortsdelete
: Can be eitherrewrite
: Must be user-defined sorts=
: Can be either!=
: Can be either, but only sound to use it on primitive sorts, since user-defined sorts could later become=
even if they aren't at the moment. I would make this only work on primitive sortsDoes that seem right?
The text was updated successfully, but these errors were encountered: