[commit: ghc] master: Modern type signature style in Module (4e0e120)
git at git.haskell.org
git at git.haskell.org
Fri May 19 14:55:16 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4e0e120bcbda6c5351d7c5aa01f7298e2198d457/ghc
>---------------------------------------------------------------
commit 4e0e120bcbda6c5351d7c5aa01f7298e2198d457
Author: Bartosz Nitka <niteria at gmail.com>
Date: Fri May 19 07:54:06 2017 -0700
Modern type signature style in Module
>---------------------------------------------------------------
4e0e120bcbda6c5351d7c5aa01f7298e2198d457
compiler/basicTypes/Module.hs | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs
index e7f8a8d..4a3212f 100644
--- a/compiler/basicTypes/Module.hs
+++ b/compiler/basicTypes/Module.hs
@@ -1249,17 +1249,20 @@ isEmptyModuleEnv (ModuleEnv e) = Map.null e
-- | A set of 'Module's
type ModuleSet = Set NDModule
-mkModuleSet :: [Module] -> ModuleSet
-extendModuleSet :: ModuleSet -> Module -> ModuleSet
-emptyModuleSet :: ModuleSet
-moduleSetElts :: ModuleSet -> [Module]
-elemModuleSet :: Module -> ModuleSet -> Bool
+mkModuleSet :: [Module] -> ModuleSet
+mkModuleSet = Set.fromList . coerce
-emptyModuleSet = Set.empty
-mkModuleSet = Set.fromList . coerce
+extendModuleSet :: ModuleSet -> Module -> ModuleSet
extendModuleSet s m = Set.insert (NDModule m) s
-moduleSetElts = sort . coerce . Set.toList
-elemModuleSet = Set.member . coerce
+
+emptyModuleSet :: ModuleSet
+emptyModuleSet = Set.empty
+
+moduleSetElts :: ModuleSet -> [Module]
+moduleSetElts = sort . coerce . Set.toList
+
+elemModuleSet :: Module -> ModuleSet -> Bool
+elemModuleSet = Set.member . coerce
{-
A ModuleName has a Unique, so we can build mappings of these using
More information about the ghc-commits
mailing list