alt-romes / hegg

Fast equality saturation in Haskell
https://hackage.haskell.org/package/hegg
BSD 3-Clause "New" or "Revised" License
75 stars 8 forks source link

Incorrect NodeMap methods and Semigroup instance #8

Closed alt-romes closed 2 years ago

alt-romes commented 2 years ago

@sjakobi reviewed the code for NodeMap and noticed multiple mistakes.

The somewhat contrieved current definition of NodeMap came to be mostly due to drastic implementation changes in different commits (one of which required that the size was stored for O(1) access).

Above all, Data.Map.size is O(1) so we can just get rid of it all and use a cost-free newtype.