lspitzner / pqueue

Haskell priority queue package
Other
15 stars 13 forks source link

Instances for `indexed-traversable` #80

Closed konsumlamm closed 2 years ago

konsumlamm commented 2 years ago

indexed-traversable provides the FunctorWithIndex, FoldableWithIndex and TravresableWithIndexed classes, all of which could be easily implemented by MinPQueue and MaxPQueue (using existing functions). The extra dependencies aren't too bad imo (pretty much only boot libraries afaict).

treeowl commented 2 years ago

Yes, with the caveat that the folding and traversing are unordered.

treeowl commented 2 years ago

How bad are the transitive dependencies?

konsumlamm commented 2 years ago

Yes, with the caveat that the folding and traversing are unordered.

No, I'm talking about MinPQueue (from Data.PQueue.Prio.Min) and MaxPQueue (from Data.PQueue.Prio.Max), which both have mapWithKey, foldrWithKey, foldlWithKey and traverseWithKey (which are all ordered).

How bad are the transitive dependencies?

For GHC >= 8.0 it's just array, base, containers and transformers (which have no relevant further dependencies). For GHC 7.10, it's quite a few more dependencies, so perhaps we should drop 7.10 support when adding a dependency on indexed-traversable.

treeowl commented 2 years ago

Extra compat deps are fine.