[commit: ghc] master: Remove 'on' from Util (41a5020)
Ian Lynagh
igloo at earth.li
Sat Jun 23 14:36:14 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/41a50207f1fb10c12518dedf07d9cfba6d41d0bc
>---------------------------------------------------------------
commit 41a50207f1fb10c12518dedf07d9cfba6d41d0bc
Author: Ian Lynagh <igloo at earth.li>
Date: Fri Jun 22 19:17:17 2012 +0100
Remove 'on' from Util
We can now rely on it being available from Data.Function
>---------------------------------------------------------------
compiler/iface/MkIface.lhs | 1 +
compiler/main/StaticFlags.hs | 1 +
compiler/main/TidyPgm.lhs | 1 +
compiler/stgSyn/StgLint.lhs | 1 +
compiler/utils/Util.lhs | 6 +-----
ghc/InteractiveUI.hs | 17 +++++++++--------
6 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index 7420dd8..0909660 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -107,6 +107,7 @@ import Bag
import Exception
import Control.Monad
+import Data.Function
import Data.List
import Data.Map (Map)
import qualified Data.Map as Map
diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs
index 3a4c2da..4695d83 100644
--- a/compiler/main/StaticFlags.hs
+++ b/compiler/main/StaticFlags.hs
@@ -98,6 +98,7 @@ import Maybes ( firstJusts )
import Panic
import Control.Monad ( liftM3 )
+import Data.Function
import Data.Maybe ( listToMaybe )
import Data.IORef
import System.IO.Unsafe ( unsafePerformIO )
diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs
index 5cd3f76..43a2db1 100644
--- a/compiler/main/TidyPgm.lhs
+++ b/compiler/main/TidyPgm.lhs
@@ -56,6 +56,7 @@ import Util
import FastString
import Control.Monad
+import Data.Function
import Data.List ( sortBy )
import Data.IORef ( readIORef, writeIORef )
\end{code}
diff --git a/compiler/stgSyn/StgLint.lhs b/compiler/stgSyn/StgLint.lhs
index ac39416..852202f 100644
--- a/compiler/stgSyn/StgLint.lhs
+++ b/compiler/stgSyn/StgLint.lhs
@@ -26,6 +26,7 @@ import SrcLoc
import Outputable
import FastString
import Control.Monad
+import Data.Function
#include "HsVersions.h"
\end{code}
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index d87f526..e22cde8 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -46,7 +46,7 @@ module Util (
nTimes,
-- * Sorting
- sortLe, sortWith, minWith, on,
+ sortLe, sortWith, minWith,
-- * Comparisons
isEqual, eqListBy, eqMaybeBy,
@@ -581,10 +581,6 @@ sortWith get_key xs = sortLe le xs
minWith :: Ord b => (a -> b) -> [a] -> a
minWith get_key xs = ASSERT( not (null xs) )
head (sortWith get_key xs)
-
-on :: (a -> a -> c) -> (b -> a) -> b -> b -> c
-on cmp sel = \x y -> sel x `cmp` sel y
-
\end{code}
%************************************************************************
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index c56f506..049b79e 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -62,6 +62,7 @@ import Control.Monad.IO.Class
import Data.Array
import qualified Data.ByteString.Char8 as BS
import Data.Char
+import Data.Function
import Data.IORef ( IORef, readIORef, writeIORef )
import Data.List ( find, group, intercalate, intersperse, isPrefixOf, nub,
partition, sort, sortBy )
@@ -989,12 +990,12 @@ filterOutChildren get_thing xs
pprInfo :: PrintExplicitForalls -> (TyThing, Fixity, [GHC.ClsInst]) -> SDoc
pprInfo pefas (thing, fixity, insts)
= pprTyThingInContextLoc pefas thing
- $$ show_fixity fixity
+ $$ show_fixity
$$ vcat (map GHC.pprInstance insts)
where
- show_fixity fix
- | fix == GHC.defaultFixity = empty
- | otherwise = ppr fix <+> pprInfixName (GHC.getName thing)
+ show_fixity
+ | fixity == GHC.defaultFixity = empty
+ | otherwise = ppr fixity <+> pprInfixName (GHC.getName thing)
-----------------------------------------------------------------------------
-- :main
@@ -2151,11 +2152,11 @@ showBindings = do
pprTT :: PrintExplicitForalls -> (TyThing, Fixity, [GHC.ClsInst]) -> SDoc
pprTT pefas (thing, fixity, _insts) =
pprTyThing pefas thing
- $$ show_fixity fixity
+ $$ show_fixity
where
- show_fixity fix
- | fix == GHC.defaultFixity = empty
- | otherwise = ppr fix <+> ppr (GHC.getName thing)
+ show_fixity
+ | fixity == GHC.defaultFixity = empty
+ | otherwise = ppr fixity <+> ppr (GHC.getName thing)
printTyThing :: TyThing -> GHCi ()
More information about the Cvs-ghc
mailing list