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

Bug: PValue needs some outer unionWith, breaks PEq #603

Closed
lemmon-714 opened this issue Nov 30, 2022 · 4 comments
Closed

Bug: PValue needs some outer unionWith, breaks PEq #603

lemmon-714 opened this issue Nov 30, 2022 · 4 comments

Comments

@lemmon-714
Copy link
Contributor

Right now it relies on AssocMap's unionWith, which drops keys that are not present in both maps. This breaks a couple of things:

  • adding/subtracting/multiplying values
  • PEq is wrong
@lemmon-714
Copy link
Contributor Author

Might also be that I'm slightly incorrect here, double-checking rn. But in any case there's undefined behaviour without some way to specify default values.

@blamario
Copy link
Collaborator

You are slightly incorrect, see issue #556 and PR #558.

@lemmon-714
Copy link
Contributor Author

So on my Plutarch version it's broken, verified it - sparing you the details until I unfuck my attempt to use nix. My version was from around August. Will let you know if it persists, but would assume you fixed it as you seemed aware of the issue.

@lemmon-714
Copy link
Contributor Author

  • I think I managed to update my Plutarch version haphazardly, probably. Very likely.
  • I need to note that even in my old version the Eq wasn't broken, I raised this issue purely looking at the comments in the code, and wondering how punionWith # (plam (-)) was supposed to work without defaults. Which it does not, but it works well enough to implement Eq.

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

2 participants