nTimes,
-- sorting
- sortLe,
+ sortLe, sortWith,
-- transitive closures
transitiveClosure,
readRational,
) where
-#include "../includes/ghcconfig.h"
#include "HsVersions.h"
import Panic ( panic, trace )
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}
%************************************************************************