A flexible implementation of custom-priority heap/priority queue based on the leftist-heaps.
The Heap.LeftiestTree implements a simple minimum priority heap. You can customize the priority value for each item to implements a maximum heap.
The Heap.PQ uses Heap.LeftiestTree and implements a simple priority queue.