Commit 41a50207 authored by Ian Lynagh's avatar Ian Lynagh

Remove 'on' from Util

We can now rely on it being available from Data.Function
parent 03caa602
......@@ -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
......
......@@ -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 )
......
......@@ -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}
......
......@@ -26,6 +26,7 @@ import SrcLoc
import Outputable
import FastString
import Control.Monad
import Data.Function
#include "HsVersions.h"
\end{code}
......
......@@ -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}
%************************************************************************
......
......@@ -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 ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment