projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2005-02-14 13:42:09 by simonmar]
[ghc-hetmet.git]
/
ghc
/
compiler
/
utils
/
Util.lhs
diff --git
a/ghc/compiler/utils/Util.lhs
b/ghc/compiler/utils/Util.lhs
index
6d2be04
..
11d1b5e
100644
(file)
--- a/
ghc/compiler/utils/Util.lhs
+++ b/
ghc/compiler/utils/Util.lhs
@@
-21,7
+21,7
@@
module Util (
nTimes,
-- sorting
nTimes,
-- sorting
- sortLe,
+ sortLe, sortWith,
-- transitive closures
transitiveClosure,
-- transitive closures
transitiveClosure,
@@
-53,7
+53,6
@@
module Util (
readRational,
) where
readRational,
) where
-#include "../includes/ghcconfig.h"
#include "HsVersions.h"
import Panic ( panic, trace )
#include "HsVersions.h"
import Panic ( panic, trace )
@@
-426,6
+425,11
@@
mergeSortLe le = generalMergeSort le
sortLe :: (a->a->Bool) -> [a] -> [a]
sortLe le = generalNaturalMergeSort le
sortLe :: (a->a->Bool) -> [a] -> [a]
sortLe le = generalNaturalMergeSort le
+
+sortWith :: Ord b => (a->b) -> [a] -> [a]
+sortWith get_key xs = sortLe le xs
+ where
+ x `le` y = get_key x < get_key y
\end{code}
%************************************************************************
\end{code}
%************************************************************************