summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Unbound.hs
diff options
context:
space:
mode:
authorM Farkas-Dyck <strake888@proton.me>2022-06-05 23:51:37 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-09-17 06:44:47 -0400
commitc9afe2216ccabd36e3083ec3b508310fcdb5eae3 (patch)
tree4d944f6afd24e20d3698e20b3a348cd2064b3919 /compiler/GHC/Rename/Unbound.hs
parent5031bf49793f3470a9fd9036829a08e556584d8a (diff)
downloadhaskell-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 'compiler/GHC/Rename/Unbound.hs')
-rw-r--r--compiler/GHC/Rename/Unbound.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/Rename/Unbound.hs b/compiler/GHC/Rename/Unbound.hs
index 5639d2a6c6..b843ff6d5a 100644
--- a/compiler/GHC/Rename/Unbound.hs
+++ b/compiler/GHC/Rename/Unbound.hs
@@ -57,6 +57,7 @@ import GHC.Utils.Outputable (empty)
import Data.List (sortBy, partition, nub)
import Data.List.NonEmpty ( pattern (:|), NonEmpty )
import Data.Function ( on )
+import qualified Data.Semigroup as S
{-
************************************************************************
@@ -303,10 +304,7 @@ importSuggestions looking_for global_env hpt currMod imports rdr_name
pick = listToMaybe . sortBy cmp . filter select
where select imv = case mod_name of Just name -> imv_name imv == name
Nothing -> not (imv_qualified imv)
- cmp a b =
- (compare `on` imv_is_hiding) a b
- `thenCmp`
- (SrcLoc.leftmost_smallest `on` imv_span) a b
+ cmp = on compare imv_is_hiding S.<> on SrcLoc.leftmost_smallest imv_span
-- Which of these would export a 'foo'
-- (all of these are restricted imports, because if they were not, we