lspitzner / pqueue

Haskell priority queue package
Other
15 stars 13 forks source link

Eq and Ord instances for Prio queues #106

Open treeowl opened 1 year ago

treeowl commented 1 year ago
treeowl commented 1 year ago

@konsumlamm Any comments?

treeowl commented 1 year ago

I really want the Eq instance to actually mean something. I think the original idea, when it was (mistakenly) thought that insertBehind could be implemented efficiently, was that Eq would be based on the order elements come out of the queue, and merge would be nondeterministic. But since insertBehind was a failure, I think we really want to make Eq equality of queues-as-maps, with merges considered deterministic. It's fine to require Ord. Is the instance really useful? Maybe not very, but the current one is nonsense. Let's do this please.

treeowl commented 1 year ago

Yes this should close #78.