diff options
author | Pepe Iborra <pepeiborra@gmail.com> | 2021-11-13 09:49:22 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-25 05:00:43 -0500 |
commit | b742475a2388b8d8a0905f6eb23a8e4fb652f77f (patch) | |
tree | 7198ca71cef418311f3e5c814f720e70ae6020e3 | |
parent | 47f36440075b766dcb0bab75ff6d51c6e6c843b2 (diff) | |
download | haskell-b742475a2388b8d8a0905f6eb23a8e4fb652f77f.tar.gz |
drop instance Semigroup InstalledModuleEnv
Instead, introduce plusInstalledModuleEnv
-rw-r--r-- | compiler/GHC/Unit/Module/Env.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/GHC/Unit/Module/Env.hs b/compiler/GHC/Unit/Module/Env.hs index fff61b871b..905b446fe2 100644 --- a/compiler/GHC/Unit/Module/Env.hs +++ b/compiler/GHC/Unit/Module/Env.hs @@ -28,6 +28,7 @@ module GHC.Unit.Module.Env , extendInstalledModuleEnv , filterInstalledModuleEnv , delInstalledModuleEnv + , plusInstalledModuleEnv ) where @@ -207,7 +208,6 @@ type DModuleNameEnv elt = UniqDFM ModuleName elt -- | A map keyed off of 'InstalledModule' newtype InstalledModuleEnv elt = InstalledModuleEnv (Map InstalledModule elt) - deriving (Monoid, Semigroup) emptyInstalledModuleEnv :: InstalledModuleEnv a emptyInstalledModuleEnv = InstalledModuleEnv Map.empty @@ -225,3 +225,6 @@ filterInstalledModuleEnv f (InstalledModuleEnv e) = delInstalledModuleEnv :: InstalledModuleEnv a -> InstalledModule -> InstalledModuleEnv a delInstalledModuleEnv (InstalledModuleEnv e) m = InstalledModuleEnv (Map.delete m e) +-- | Left-biased +plusInstalledModuleEnv :: InstalledModuleEnv a -> InstalledModuleEnv a -> InstalledModuleEnv a +plusInstalledModuleEnv (InstalledModuleEnv a) (InstalledModuleEnv b) = InstalledModuleEnv (a `mappend` b) |