projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
convert to use System.FilePath
[ghc-hetmet.git]
/
compiler
/
utils
/
Util.lhs
diff --git
a/compiler/utils/Util.lhs
b/compiler/utils/Util.lhs
index
495df82
..
e5f7023
100644
(file)
--- a/
compiler/utils/Util.lhs
+++ b/
compiler/utils/Util.lhs
@@
-26,7
+26,7
@@
module Util (
nTimes,
-- sorting
nTimes,
-- sorting
- sortLe, sortWith,
+ sortLe, sortWith, on,
-- transitive closures
transitiveClosure,
-- transitive closures
transitiveClosure,
@@
-457,6
+457,10
@@
sortWith :: Ord b => (a->b) -> [a] -> [a]
sortWith get_key xs = sortLe le xs
where
x `le` y = get_key x < get_key y
sortWith get_key xs = sortLe le xs
where
x `le` y = get_key x < get_key y
+
+on :: (a -> a -> Ordering) -> (b -> a) -> b -> b -> Ordering
+on cmp sel = \x y -> sel x `cmp` sel y
+
\end{code}
%************************************************************************
\end{code}
%************************************************************************