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 /compiler/GHC/Unit/Module.hs | |
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 'compiler/GHC/Unit/Module.hs')
-rw-r--r-- | compiler/GHC/Unit/Module.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/GHC/Unit/Module.hs b/compiler/GHC/Unit/Module.hs index 7ae0059b71..030dd5a39f 100644 --- a/compiler/GHC/Unit/Module.hs +++ b/compiler/GHC/Unit/Module.hs @@ -49,10 +49,11 @@ import GHC.Types.Unique.DSet import GHC.Unit.Types import GHC.Unit.Module.Location import GHC.Unit.Module.Env -import GHC.Utils.Misc import Language.Haskell.Syntax.Module.Name +import Data.Semigroup + -- | A 'Module' is definite if it has no free holes. moduleIsDefinite :: Module -> Bool moduleIsDefinite = isEmptyUniqDSet . moduleFreeHoles @@ -69,9 +70,7 @@ moduleStableString Module{..} = -- gives an ordering based on the 'Unique's of the components, which may -- not be stable from run to run of the compiler. stableModuleCmp :: Module -> Module -> Ordering -stableModuleCmp (Module p1 n1) (Module p2 n2) - = (p1 `stableUnitCmp` p2) `thenCmp` - (n1 `stableModuleNameCmp` n2) +stableModuleCmp (Module p1 n1) (Module p2 n2) = stableUnitCmp p1 p2 <> stableModuleNameCmp n1 n2 class ContainsModule t where extractModule :: t -> Module |