projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make dph-seq and dph-par wired-in packages
[ghc-hetmet.git]
/
compiler
/
basicTypes
/
Module.lhs
diff --git
a/compiler/basicTypes/Module.lhs
b/compiler/basicTypes/Module.lhs
index
8d9cb3b
..
57509a0
100644
(file)
--- a/
compiler/basicTypes/Module.lhs
+++ b/
compiler/basicTypes/Module.lhs
@@
-19,6
+19,7
@@
module Module
moduleNameSlashes,
mkModuleName,
mkModuleNameFS,
moduleNameSlashes,
mkModuleName,
mkModuleNameFS,
+ stableModuleNameCmp,
-- * The PackageId type
PackageId,
-- * The PackageId type
PackageId,
@@
-26,6
+27,7
@@
module Module
packageIdFS,
stringToPackageId,
packageIdString,
packageIdFS,
stringToPackageId,
packageIdString,
+ stablePackageIdCmp,
-- * Wired-in PackageIds
primPackageId,
-- * Wired-in PackageIds
primPackageId,
@@
-35,6
+37,8
@@
module Module
haskell98PackageId,
thPackageId,
ndpPackageId,
haskell98PackageId,
thPackageId,
ndpPackageId,
+ dphSeqPackageId,
+ dphParPackageId,
mainPackageId,
-- * The Module type
mainPackageId,
-- * The Module type
@@
-161,6
+165,10
@@
instance Binary ModuleName where
put_ bh (ModuleName fs) = put_ bh fs
get bh = do fs <- get bh; return (ModuleName fs)
put_ bh (ModuleName fs) = put_ bh fs
get bh = do fs <- get bh; return (ModuleName fs)
+stableModuleNameCmp :: ModuleName -> ModuleName -> Ordering
+-- Compare lexically, not by unique
+stableModuleNameCmp n1 n2 = moduleNameFS n1 `compare` moduleNameFS n2
+
pprModuleName :: ModuleName -> SDoc
pprModuleName (ModuleName nm) =
getPprStyle $ \ sty ->
pprModuleName :: ModuleName -> SDoc
pprModuleName (ModuleName nm) =
getPprStyle $ \ sty ->
@@
-184,7
+192,6
@@
mkModuleNameFS s = ModuleName s
moduleNameSlashes :: ModuleName -> String
moduleNameSlashes = dots_to_slashes . moduleNameString
where dots_to_slashes = map (\c -> if c == '.' then pathSeparator else c)
moduleNameSlashes :: ModuleName -> String
moduleNameSlashes = dots_to_slashes . moduleNameString
where dots_to_slashes = map (\c -> if c == '.' then pathSeparator else c)
-
\end{code}
%************************************************************************
\end{code}
%************************************************************************
@@
-213,8
+220,8
@@
instance Binary Module where
-- not be stable from run to run of the compiler.
stableModuleCmp :: Module -> Module -> Ordering
stableModuleCmp (Module p1 n1) (Module p2 n2)
-- not be stable from run to run of the compiler.
stableModuleCmp :: Module -> Module -> Ordering
stableModuleCmp (Module p1 n1) (Module p2 n2)
- = (packageIdFS p1 `compare` packageIdFS p2) `thenCmp`
- (moduleNameFS n1 `compare` moduleNameFS n2)
+ = (p1 `stablePackageIdCmp` p2) `thenCmp`
+ (n1 `stableModuleNameCmp` n2)
mkModule :: PackageId -> ModuleName -> Module
mkModule = Module
mkModule :: PackageId -> ModuleName -> Module
mkModule = Module
@@
-254,6
+261,9
@@
instance Uniquable PackageId where
instance Ord PackageId where
nm1 `compare` nm2 = getUnique nm1 `compare` getUnique nm2
instance Ord PackageId where
nm1 `compare` nm2 = getUnique nm1 `compare` getUnique nm2
+stablePackageIdCmp :: PackageId -> PackageId -> Ordering
+stablePackageIdCmp p1 p2 = packageIdFS p1 `compare` packageIdFS p2
+
instance Outputable PackageId where
ppr pid = text (packageIdString pid)
instance Outputable PackageId where
ppr pid = text (packageIdString pid)
@@
-304,6
+314,8
@@
rtsPackageId = fsToPackageId (fsLit "rts")
haskell98PackageId = fsToPackageId (fsLit "haskell98")
thPackageId = fsToPackageId (fsLit "template-haskell")
ndpPackageId = fsToPackageId (fsLit "ndp")
haskell98PackageId = fsToPackageId (fsLit "haskell98")
thPackageId = fsToPackageId (fsLit "template-haskell")
ndpPackageId = fsToPackageId (fsLit "ndp")
+dphSeqPackageId = fsToPackageId (fsLit "dph-seq")
+dphParPackageId = fsToPackageId (fsLit "dph-par")
-- This is the package Id for the program. It is the default package
-- Id if you don't specify a package name. We don't add this prefix
-- This is the package Id for the program. It is the default package
-- Id if you don't specify a package name. We don't add this prefix