sdp-0.2: Simple Data Processing
Copyright(c) Andrey Mulik 2019
LicenseBSD-style
Maintainerwork.a.mulik@gmail.com
Portabilitynon-portable (requires non-portable modules)
Safe HaskellSafe
LanguageHaskell2010

SDP.SortM.Tim

Contents

Description

SDP.SortM.Tim provides InsertionSort and TimSort algorithms.

Synopsis

TimSort

timSort :: (LinearM m v e, BorderedM m v i, Ord e) => v -> m () Source #

timSort is just synonym for timSortBy compare.

timSortBy :: (LinearM m v e, BorderedM m v i) => Compare e -> v -> m () Source #

timSortBy is a sorting procedure for mutable random access data structures using any comparison function and having O(nlogn) complexity in the worst case.

timSortOn :: (LinearM m v e, BorderedM m v i, Ord o) => (e -> o) -> v -> m () Source #

timSortOn is a version of timSortBy that uses a conversion function to compare elements.

minrunTS :: Int -> Int Source #

minrunTS returns TimSort chunk size by given length.