lspitzner / pqueue

Haskell priority queue package
Other
15 stars 13 forks source link

Make mapU/mapMonotonic and Prio.mapKeysMonotonic spine-strict #100

Closed treeowl closed 1 year ago

treeowl commented 1 year ago

I closed #95 because seqSpine is potentially useful to force the spine after mapU/mapMonotonic or Prio.mapKeysMonotonic. But thinking about it today, I realized that those operations should almost certainly be spine-strict anyway. There's almost nothing useful you can do to a queue without potentially forcing its spine. So I'd like to make those operations force the spine, and then bring #95 back with better documentation.

treeowl commented 1 year ago

I guess we should do this with all the other maps too. They're hideously inefficient, but I don't think this makes them much worse. The only way to make them reasonably efficient would be to make the binomial trees lazy, and I'm reluctant to go back to that; it opens up too many potential strictness bugs just to support operations that are likely rare.