packages feed

pqueue-1.5.0.0 / benchmarks / PHeapSort.hs

module PHeapSort whereimport Data.PQueue.Prio.Min (MinPQueue)import qualified Data.PQueue.Prio.Min as Pimport System.RandomheapSortRandoms :: Int -> StdGen -> [Int]heapSortRandoms n gen = heapSort $ take n (randoms gen)heapSort :: Ord a => [a] -> [a]heapSort xs = [b | (b, ~()) <- P.toAscList . P.fromList . map (\a -> (a, ())) $ xs]