summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPepe Iborra <pepeiborra@gmail.com>2021-11-06 07:58:43 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-25 05:00:43 -0500
commit52cdc2fe84b5d27de10845795ef56d0c89ff3091 (patch)
tree2f69f134a927c9b6c671104b58a50a310d6a7ad6
parent96b3899efc578f467037f6282551b7aae510081a (diff)
downloadhaskell-52cdc2fe84b5d27de10845795ef56d0c89ff3091.tar.gz
Monoid instance for InstalledModuleEnv
-rw-r--r--compiler/GHC/Unit/Module/Env.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Unit/Module/Env.hs b/compiler/GHC/Unit/Module/Env.hs
index cf056e2bdf..be596bbc76 100644
--- a/compiler/GHC/Unit/Module/Env.hs
+++ b/compiler/GHC/Unit/Module/Env.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- | Module environment
module GHC.Unit.Module.Env
( -- * Module mappings
@@ -50,6 +51,7 @@ import qualified GHC.Data.FiniteMap as Map
-- | A map keyed off of 'Module's
newtype ModuleEnv elt = ModuleEnv (Map NDModule elt)
+ deriving (Monoid, Semigroup)
{-
Note [ModuleEnv performance and determinism]
@@ -206,6 +208,7 @@ 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