vector-quicksort-0.1: Fast and flexible quicksort implementation for mutable vectors
Copyright(c) Sergey Vinokurov 2023
LicenseApache-2.0 (see LICENSE)
Maintainerserg.foo@gmail.com
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Vector.Algorithms.Heapsort

Description

 
Synopsis

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.