diff options
author | M Farkas-Dyck <strake888@proton.me> | 2022-06-05 23:51:37 -0800 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-09-17 06:44:47 -0400 |
commit | c9afe2216ccabd36e3083ec3b508310fcdb5eae3 (patch) | |
tree | 4d944f6afd24e20d3698e20b3a348cd2064b3919 /ghc | |
parent | 5031bf49793f3470a9fd9036829a08e556584d8a (diff) | |
download | haskell-c9afe2216ccabd36e3083ec3b508310fcdb5eae3.tar.gz |
Clean up some. In particular:
• Delete some dead code, largely under `GHC.Utils`.
• Clean up a few definitions in `GHC.Utils.(Misc, Monad)`.
• Clean up `GHC.Types.SrcLoc`.
• Derive stock `Functor, Foldable, Traversable` for more types.
• Derive more instances for newtypes.
Bump haddock submodule.
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 3751711b9d..3cf0c642c6 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -132,6 +132,7 @@ import qualified Data.IntMap.Strict as IntMap import Data.Time.LocalTime ( getZonedTime ) import Data.Time.Format ( formatTime, defaultTimeLocale ) import Data.Version ( showVersion ) +import qualified Data.Semigroup as S import Prelude hiding ((<>)) import GHC.Utils.Exception as Exception hiding (catch, mask, handle) @@ -1416,9 +1417,7 @@ printTypeOfNames names = mapM_ (printTypeOfName ) $ sortBy compareNames names compareNames :: Name -> Name -> Ordering -n1 `compareNames` n2 = - (compare `on` getOccString) n1 n2 `thenCmp` - (SrcLoc.leftmost_smallest `on` getSrcSpan) n1 n2 +compareNames = on compare getOccString S.<> on SrcLoc.leftmost_smallest getSrcSpan printTypeOfName :: GHC.GhcMonad m => Name -> m () printTypeOfName n @@ -3844,10 +3843,7 @@ enclosingTickSpan md (RealSrcSpan src _) = do where leftmostLargestRealSrcSpan :: RealSrcSpan -> RealSrcSpan -> Ordering -leftmostLargestRealSrcSpan a b = - (realSrcSpanStart a `compare` realSrcSpanStart b) - `thenCmp` - (realSrcSpanEnd b `compare` realSrcSpanEnd a) +leftmostLargestRealSrcSpan = on compare realSrcSpanStart S.<> on (flip compare) realSrcSpanEnd traceCmd :: GhciMonad m => String -> m () traceCmd arg |