Reliable, persistent, fast priority queues.


Version on this page:
LTS Haskell 21.12:
Stackage Nightly 2023-09-22:
Latest on Hackage:

See all snapshots pqueue appears in

BSD-3-Clause licensed by Louis Wasserman
This version can be pinned in stack with:pqueue-,3231

Module documentation for


A fast, reliable priority queue implementation based on a binomial heap.

For more information, see pqueue on Hackage.


Revision history for pqueue – 2022-10-30 – 2022-06-19

  • Overall performance has improved greatly, especially when there are many insertions and/or merges in a row. Insertion, deletion, and merge are now worst case logarithmic, while maintaining their previous amortized bounds. (#26)

  • New mapMWithKey functions optimized for working in strict monads. These are used to implement the mapM and sequence methods of Traversable. (#46)

  • Define stimes in the Semigroup instances. (#57)

  • Add strict left unordered folds (foldlU', foldlWithKeyU') and monoidal unordered folds (foldMapU, foldMapWithKeyU). (#59)

  • New functions for adjusting and updating the min/max of a key-value priority queue in an Applicative context. (#66)

  • Fixed Data.PQueue.Max.map to work on MaxQueues. (#76) – 2021-12-04

  • Maintenance release for ghc-9.0 & ghc-9.2 support
  • Change nix-setup to use the seaaye tool – 2020-06-06

  • Maintenance release
  • Add missing documentation
  • Add nix-expressions for testing against different compilers/package sets – 2018-09-26

  • Maintenance release for ghc-8.6
  • Drop support for ghc<7.10 – 2018-02-11

  • Remove/replace buggy insertBehind implementation.

    The existing implementation did not always insert behind. As a fix, the function was removed from Data.PQueue.Max/Min and was rewritten with a O(n) complexity (!) for Data.PQueue.Prio.Max/Min.

  • Adapt for ghc-8.4, based on the ghc-8.4.1-alpha1 release

  • Drop support for ghc<7.4 – 2017-08-01

  • Maintenance release for ghc-8.2 – 2017-03-12

  • Add test-suite from darcs repository for pqueue-1.0.1. – 2017-03-11

  • Fix documentation errors
    • complexity on toList, toListU
    • PQueue.Prio.Max had “ascending” instead of “descending” in some places

1.3.2 – 2016-09-28

  • Add function insertBehind as a slight variation of insert which differs in behaviour for elements the compare equal. – 2016-05-21

  • Ensure compatibility with ghc-8
  • Minor internal refactors

1.3.1 – 2015-10-03

  • Add Monoid instance for MaxPQueue

1.3.0 – 2015-06-23

  • Lennart Spitzner starts co-maintaining
  • new git repository at github.com:lspitzner/pqueue
  • Ensure compatibility with ghc-7.10