Skip to content

Conversation

@kalzoo
Copy link
Contributor

@kalzoo kalzoo commented Jun 5, 2024

Make Instruction and all of its sub-structs both Hash and Eq:

  • Handle f64 equality as NaN == NaN which is defensible in the case of equating instructions
  • Handle IndexMap equality by relying on iteration order. This is suboptimal in that ordering shouldn't matter for equality checks, but sorting them would be expensive. This is where BTreeMap may actually make more sense, but that doesn't need to be addressed here. This was discussed in the past and I recall that there was a good reason not to select it, even if I forget that reason now.

TODO

  • right now, we just impl Eq for TypeX when it contains f64, which in effect will just cause a panic when one of those f64 is NaN. this should be better handled and possibly include a PartialEq override.

@github-actions
Copy link

github-actions bot commented Jun 5, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://rigetti.github.io/quil-rs/pr-preview/pr-374/
on branch quil-py-docs at 2024-06-05 23:59 UTC

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

Successfully merging this pull request may close these issues.

2 participants