sort -containers -bytestring

sort :: Ord a => [a] -> [a]
base Data.List
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.
sortBy :: (a -> a -> Ordering) -> [a] -> [a]
base Data.List
The sortBy function is the non-overloaded version of sort.
package sort-by-pinyin
Sort simplified Chinese by PinYin Version 2012.6.5
package sorted
Sorted data types and operations that preserve their sorting. Version 0.0.1
sortWith :: Ord b => (a -> b) -> [a] -> [a]
base GHC.Exts
The sortWith function sorts a list of elements using the user supplied function to project something out of each element
package sorty
This simple tool sorts input filelines by first collumn suffixed by unit. Recognized units: > k = 1000 > m = 1000 * k > g = 1000 * m > K = 1024 > M = 1024 * K > G = 1024 * G I needed this for output from 'du -h': > $ du -h -a > 4,0K   ./sorty.cabal > 20K   ./sorty.o > 0   ./.#sorty.cabal > 4,0K   ./#sorty.cabal# > 4,0K   ./sorty.hs~ > 4,0K   ./sorty.hs > 4,0K   ./sorty.hi > 868K   ./sorty > 912K   . Filtered through sorty: > $ du -h -a | ./sorty > 0   ./.#sorty.cabal > 4,0K   ./sorty.cabal > 4,0K   ./#sorty.cabal# > 4,0K   ./sorty.hs~ > 4,0K   ./sorty.hs > 4,0K   ./sorty.hi > 20K   ./sorty.o > 868K   ./sorty > 912K   . Version 0.1.1
package cabal-sort
If you have a bunch of packages you may want to compile or recompile, then you need an order of compilation that meets the dependencies. Given a number of cabal package files, this program reads all those files and emits them topologically sorted according to their dependencies. This way you can compile many packages at once, say if a very low-level package has changed. For compiling a couple of packages from their local darcs repositories in the right order, you may run something like > for dir in `find . -name "*.cabal" | fgrep -v _darcs > | xargs cabal-sort --info=dir`; do (cd $dir && cabal install); done Note that cabal-install does this automatically since version 0.10 when you call it will multiple directory names as arguments. However, when the constraint solver in cabal-install fails you may still use cabal-sort for an automated build. For uploading a set of packages to Hackage in the right order you may run > for dir in `find . -name "*.cabal" | fgrep -v _darcs > | xargs cabal-sort --info=dir`; do (cd $dir && rm dist/*.tar.gz > && cabal sdist && cabal upload dist/*.tar.gz); done Sometimes you have to inspect a number of packages manually, e.g. in order to adapt your packages to a new GHC version. In this case I found it useful to run > for dir in `find . -name "*.cabal" | fgrep -v _darcs > | xargs cabal-sort --info=dir`; do (cd $dir; bash); done@. This way you start a local shell for every package. Then you can easily access commands in the shell history that you already run for previous packages, e.g. editor *.cabal. After you finished a package, you switch to the next package simply by leaving the shell by calling exit. Problem 1: Given packages A, B, C, where C depends on B and B depends on A, and you call > cabal-sort C.cabal A.cabal then the emitted order of packages may be wrong, because cabal-sort does not get to know the dependency of C on B. Even if the order is correct, B.cabal is missing in the output and thus the list of cabal files cannot immediately be used for a sequence of cabal-install runs. Problem 2: We ignore flags and merge all dependencies. This may lead to dependency cycles that cannot occur for any flag assignment. You also have options --parallel and --makefile that support parallel compilation. The first option is for manual parallelization and the second one allows you to compile parallelly using make's -j/--jobs option. There is a second program called ghc-pkg-dep that finds recursively all packages that a set of packages depends on. Duplicates are eliminated and the packages are given topologically sorted, such that you can use this for recompilation of the packages. The packages must already be registered with ghc-pkg. > ghc-pkg-dep pkgA-0.1 pkgB-2.3 pkgC-0.1.2 On GHC versions before 7.0 ghc-pkg runs quite slowly. In order to not get bored you may run the program with --verbose=2 option. Version
package external-sort
Sort arrays too large to fit in ram, by using your hard drive. Version 0.2
heapsort :: Ord a => [a] -> [a]
fgl Data.Graph.Inductive.Internal.Heap
package heapsort
Heapsort of MArrays Version 0.1.0
package natural-sort
The built-in comparisons for textual data are based on Unicode ordinals. This does not match most every-day sorting algorithms. For example, "z10.txt" is sorted after "z2.txt" by users, but before it by naïve algorithms. This package provides an implementation of "natural sort", which more closely matches user expectations. See also: Version 0.1.2
package NaturalSort
A library for sorting strings &quot;naturally&quot;, i.e. taking numerical values into account when comparing textual inputs. E.g., &quot;1&quot; < &quot;10&quot;, and &quot;10 bottles of beer&quot; < &quot;100 bottles of beer&quot;. Version 0.2.1
topsort :: Graph gr => gr a b -> [Node]
fgl Data.Graph.Inductive.Query.DFS
topsort' :: Graph gr => gr a b -> [a]
fgl Data.Graph.Inductive.Query.DFS