


Description 
Safe implementation of an arraybacked binary heap. The HeapT transformer requires that the underlying monad provide a MonadST instance, meaning that the bottomlevel monad must be ST. This critical restriction protects referential transparency, disallowing multithreaded behavior as if the '[]' monad were at the bottom level. (The HeapM monad takes care of the ST bottom level automatically.)


Synopsis 



Documentation 


Monad based on an array implementation of a standard binary heap.



Monad transformer based on an array implementation of a standard binary heap.
 Instances  



Runs an HeapM computation starting with an empty heap.







:: (MonadST m, Monad m, Ord e)   => HeapT e m a  The transformer operation.
 > Int  The starting size of the heap (must be equal to the length of the list)
 > [e]  The initial contents of the heap
 > m a   Runs an HeapM computation starting with a heap initialized to hold the specified list. (Since this can be done with linear preprocessing, this is more efficient than inserting the elements one by one.)




Instances  




Produced by Haddock version 2.4.1 