vector-algorithms-0.5.1: Efficient algorithms for vector arrays

PortabilityNon-portable ()
StabilityExperimental
MaintainerDan Doel <dan.doel@gmail.com>

Data.Vector.Algorithms.AmericanFlag

Description

This module implements American flag sort: an in-place, unstable, bucket sort. Also in contrast to radix sort, the values are inspected in a big endian order, and buckets are sorted via recursive splitting. This, however, makes it sensible for sorting strings in lexicographic order (provided indexing is fast).

Documentation

sort :: forall e m v. (PrimMonad m, MVector v e, Lexicographic e, Ord e) => v (PrimState m) e -> m ()Source

sortBy :: (PrimMonad m, MVector v e) => Comparison e -> (e -> Int -> Bool) -> Int -> (Int -> e -> Int) -> v (PrimState m) e -> m ()Source