[commit: ghc] master: Library docs: Document the order for sort and sortOn. (d266aac)

git at git.haskell.org git at git.haskell.org
Thu Feb 9 18:17:32 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d266aac9586d42295df56ca077746d3876a1c849/ghc

>---------------------------------------------------------------

commit d266aac9586d42295df56ca077746d3876a1c849
Author: Alexander Kjeldaas <ak at formalprivacy.com>
Date:   Thu Feb 9 00:26:02 2017 +0100

    Library docs: Document the order for sort and sortOn.
    
    This closes GH-22.


>---------------------------------------------------------------

d266aac9586d42295df56ca077746d3876a1c849
 libraries/base/Data/OldList.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libraries/base/Data/OldList.hs b/libraries/base/Data/OldList.hs
index c3618c4..428d3bd 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 =



More information about the ghc-commits mailing list