summaryrefslogtreecommitdiff
path: root/compiler/utils/Util.lhs
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2014-08-08 18:01:19 +0200
committerGabor Greif <ggreif@gmail.com>2014-08-08 18:01:19 +0200
commit5f003d228340c3ce8e500f9053f353c58dc1dc94 (patch)
treea855b0f173ff635b48354e1136ef6cbb2a1214a4 /compiler/utils/Util.lhs
parentff9c5570395bcacf8963149b3a8475f5644ce694 (diff)
parentdff0623d5ab13222c06b3ff6b32793e05b417970 (diff)
downloadhaskell-wip/generics-propeq.tar.gz
Merge branch 'master' into wip/generics-propeqwip/generics-propeq
Conflicts: compiler/typecheck/TcGenGenerics.lhs
Diffstat (limited to 'compiler/utils/Util.lhs')
-rw-r--r--compiler/utils/Util.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index 0274c590ea..2dcc73fd89 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -47,7 +47,7 @@ module Util (
nTimes,
-- * Sorting
- sortWith, minWith,
+ sortWith, minWith, nubSort,
-- * Comparisons
isEqual, eqListBy, eqMaybeBy,
@@ -126,6 +126,7 @@ import Data.Ord ( comparing )
import Data.Bits
import Data.Word
import qualified Data.IntMap as IM
+import qualified Data.Set as Set
import Data.Time
#if __GLASGOW_HASKELL__ < 705
@@ -490,6 +491,9 @@ sortWith get_key xs = sortBy (comparing get_key) xs
minWith :: Ord b => (a -> b) -> [a] -> a
minWith get_key xs = ASSERT( not (null xs) )
head (sortWith get_key xs)
+
+nubSort :: Ord a => [a] -> [a]
+nubSort = Set.toAscList . Set.fromList
\end{code}
%************************************************************************