traverse package:heaps

O(n log n). Traverse the elements of the heap in sorted order and produce a new heap using Applicative side-effects.