I was looking at the isle code and had some q’s: is stable map the same as a normal hash map without the non deterministic iterative methods, and for DisjointSets, in the merge fn, why is the assert_neq! necessary for x and y as opposed to an early return?
First Q: yes, stablemap is a way to ensure deterministic output (of the isle compiler) with some type safety
second Q: it seems like just an API design question; here the data structure requires that a merge is a real merge, it could have been designed to short-circuit this case
there's some subtlety around "every set has at least two members" that I don't quite fully understand either; @Jamey Sharp may be able to say more
Last updated: Nov 22 2024 at 16:03 UTC