-
Notifications
You must be signed in to change notification settings - Fork 4
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
Tagged union #97
Tagged union #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good.
If I understand correctly, each ADT type is either "attribute based" and/or "getitem based". Each ADT metaclass can now inherit from one or both of these and have the fields accessed via attribute and/or getitem. In addition one can specify if each of these ADT types are ordered. This would probably make it easier to make a coproduct adt type (ordered Sum) or an unordered Product.
One minor issue, is that I am sure we have code scattered throughout that checks if a type is (Product, Tuple, Sum). These will have to be augmented to included tagged union. This should not block the PR though. |
Correct
In practice yes but not really what's going on.
Correct |
Looks good to me! Tests are clear. |
Adds TaggedUnion syntax as described in cdonovick/peak#68 (comment)
Breaks GarnettFlow because change to internal interfaces that magma will have to adopt but it should be a 1 line change in
magma/product.py