Copyright | (c) Sergey Vinokurov 2023 |
---|---|
License | Apache-2.0 (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Documentation
heapSort :: (PrimMonad m, Ord a, MVector v a) => v (PrimState m) a -> m () Source #
O(N * log(N)) regular heapsort (with 2-way heap, whereas vector-algorithm's is 4-way). Can be used as a standalone sort but main purpose is fallback sort for quicksort.
Depending on GHC may be good candidate for SPECIALIZE pragma.