-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A Haskell sorting toolkit
--   
--   A library of general-purpose sorting utilities.
@package sort
@version 1.0.0.0

module Data.Sort

-- | The <a>sort</a> function implements a stable sorting algorithm. It is
--   a special case of <a>sortBy</a>, which allows the programmer to supply
--   their own comparison function.
--   
--   Elements are arranged from from lowest to highest, keeping duplicates
--   in the order they appeared in the input.
sort :: Ord a => [a] -> [a]

-- | The <a>sortBy</a> function is the non-overloaded version of
--   <a>sort</a>.
sortBy :: () => (a -> a -> Ordering) -> [a] -> [a]

-- | Sort a list by comparing the results of a key function applied to each
--   element. <tt>sortOn f</tt> is equivalent to <tt>sortBy (comparing
--   f)</tt>, but has the performance advantage of only evaluating
--   <tt>f</tt> once for each element in the input list. This is called the
--   decorate-sort-undecorate paradigm, or Schwartzian transform.
--   
--   Elements are arranged from from lowest to highest, keeping duplicates
--   in the order they appeared in the input.
sortOn :: Ord b => (a -> b) -> [a] -> [a]

-- | Sort the list of associations, aggregating duplicates with the monoid.
monoidSortAssocs :: (Monoid a, Ord k) => [(k, a)] -> [(k, a)]

-- | Sort the list of associations, aggregating duplicates with the monoid
--   and ordering the keys with the argument compare function.
monoidSortAssocsBy :: (Monoid a) => (k -> k -> Ordering) -> [(k, a)] -> [(k, a)]

-- | Sort the list of associations, aggregating duplicates with the
--   supplied function.
groupSortAssocs :: Ord k => (k -> a -> [a] -> b) -> [(k, a)] -> [(k, b)]

-- | Sort the list of associations, aggregating duplicates with the
--   supplied function and ordering the keys with the argument compare
--   function.
groupSortAssocsBy :: (k -> k -> Ordering) -> (k -> a -> [a] -> b) -> [(k, a)] -> [(k, b)]

-- | Sort the list, agregating duplicates with the monoid.
monoidSort :: (Monoid a, Ord a) => [a] -> [a]

-- | Sort the list, agregating duplicates with the monoid and ordering the
--   elements by the items generated by the argument function.
monoidSortOn :: (Monoid a, Ord k) => (a -> k) -> [a] -> [a]

-- | Sort the list, agregating duplicates with the monoid and ordering the
--   keys with the argument compare function.
monoidSortBy :: Monoid a => (a -> a -> Ordering) -> [a] -> [a]

-- | Sort the list, discarding duplicates.
uniqueSort :: Ord a => [a] -> [a]

-- | Sort the list, discarding duplicates and ordering the elements by the
--   items generated by the argument function.
uniqueSortOn :: Ord k => (a -> k) -> [a] -> [a]

-- | Sort the list, discarding duplicates and ordering the keys with the
--   argument compare function.
uniqueSortBy :: (a -> a -> Ordering) -> [a] -> [a]

-- | Sort a list of elements with a stable sort, grouping together the
--   equal elements with the argument grouping function
groupSort :: (Ord a) => (a -> [a] -> b) -> [a] -> [b]

-- | Sort a list of elements with a stable sort, using the argument
--   <tt>compare</tt> function determine the ordering, grouping together
--   the equal elements with the grouping function
groupSortOn :: Ord k => (a -> k) -> (k -> a -> [a] -> b) -> [a] -> [b]

-- | Sort a list of elements with a stable sort, grouping together the
--   equal elements with the argument grouping function.
groupSortBy :: (a -> a -> Ordering) -> (a -> [a] -> b) -> [a] -> [b]
