uvector-algorithms-0.2: Efficient algorithms for uvector unboxed arraysSource codeContentsIndex
Data.Array.Vector.Algorithms.Merge
PortabilityPortable
StabilityExperimental
MaintainerDan Doel <dan.doel@gmail.com>
Description
This module implements a simple top-down merge sort. The temporary buffer is preallocated to 1/2 the size of the input array, and shared through the entire sorting process to ease the amount of allocation performed in total. This is a stable sort.
Synopsis
sort :: (Ord e, UA e) => MUArr e s -> ST s ()
sortBy :: UA e => Comparison e -> MUArr e s -> ST s ()
sortByBounds :: UA e => Comparison e -> MUArr e s -> Int -> Int -> ST s ()
type Comparison e = e -> e -> Ordering
Documentation
sort :: (Ord e, UA e) => MUArr e s -> ST s ()Source
Sorts an array using the default comparison.
sortBy :: UA e => Comparison e -> MUArr e s -> ST s ()Source
Sorts an array using a custom comparison.
sortByBounds :: UA e => Comparison e -> MUArr e s -> Int -> Int -> ST s ()Source
Sorts a portion of an array [l,u) using a custom comparison.
type Comparison e = e -> e -> OrderingSource
A type of comparisons between two values of a given type.
Produced by Haddock version 2.4.2