summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kjeldaas <ak@formalprivacy.com>2017-02-09 00:26:02 +0100
committerJoachim Breitner <mail@joachim-breitner.de>2017-02-09 13:15:54 -0500
commitd266aac9586d42295df56ca077746d3876a1c849 (patch)
tree8fc7e1600d1394d2f4c2dcf0837496fd9a175bcc
parenta6a4d0e1b558166c87b4f60500855fcd5f088f7c (diff)
downloadhaskell-d266aac9586d42295df56ca077746d3876a1c849.tar.gz
Library docs: Document the order for sort and sortOn.
This closes GH-22.
-rw-r--r--libraries/base/Data/OldList.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/libraries/base/Data/OldList.hs b/libraries/base/Data/OldList.hs
index c3618c42a9..428d3bded9 100644
--- a/libraries/base/Data/OldList.hs
+++ b/libraries/base/Data/OldList.hs
@@ -815,6 +815,9 @@ permutations xs0 = xs0 : perms xs0 []
-- | The 'sort' function implements a stable sorting algorithm.
-- It is a special case of 'sortBy', 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 'sortBy' function is the non-overloaded version of 'sort'.
@@ -978,6 +981,9 @@ rqpart cmp x (y:ys) rle rgt r =
-- 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.
+--
-- @since 4.8.0.0
sortOn :: Ord b => (a -> b) -> [a] -> [a]
sortOn f =