projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
178eeaa
)
Replace couple of fromJust with expectJust
author
Clemens Fruhwirth
<clemens@endorphin.org>
Fri, 7 Nov 2008 16:07:35 +0000
(16:07 +0000)
committer
Clemens Fruhwirth
<clemens@endorphin.org>
Fri, 7 Nov 2008 16:07:35 +0000
(16:07 +0000)
compiler/ghci/InteractiveUI.hs
patch
|
blob
|
history
compiler/ghci/Linker.lhs
patch
|
blob
|
history
compiler/main/PackageConfig.hs
patch
|
blob
|
history
compiler/typecheck/FamInst.lhs
patch
|
blob
|
history
diff --git
a/compiler/ghci/InteractiveUI.hs
b/compiler/ghci/InteractiveUI.hs
index
4fdf949
..
933a98e
100644
(file)
--- a/
compiler/ghci/InteractiveUI.hs
+++ b/
compiler/ghci/InteractiveUI.hs
@@
-52,7
+52,7
@@
import StaticFlags
import Linker
import Util
import NameSet
import Linker
import Util
import NameSet
-import Maybes ( orElse )
+import Maybes ( orElse, expectJust )
import FastString
import Encoding
import MonadUtils ( liftIO )
import FastString
import Encoding
import MonadUtils ( liftIO )
@@
-2247,7
+2247,7
@@
listModuleLine modl line = do
case this of
[] -> panic "listModuleLine"
summ:_ -> do
case this of
[] -> panic "listModuleLine"
summ:_ -> do
- let filename = fromJust (ml_hs_file (GHC.ms_location summ))
+ let filename = expectJust "listModuleLine" (ml_hs_file (GHC.ms_location summ))
loc = GHC.mkSrcLoc (mkFastString (filename)) line 0
io $ listAround (GHC.srcLocSpan loc) False
loc = GHC.mkSrcLoc (mkFastString (filename)) line 0
io $ listAround (GHC.srcLocSpan loc) False
diff --git
a/compiler/ghci/Linker.lhs
b/compiler/ghci/Linker.lhs
index
8ad2be8
..
0de30af
100644
(file)
--- a/
compiler/ghci/Linker.lhs
+++ b/
compiler/ghci/Linker.lhs
@@
-78,7
+78,6
@@
import System.Directory
import Distribution.Package hiding (depends, PackageId)
import Exception
import Distribution.Package hiding (depends, PackageId)
import Exception
-import Data.Maybe
\end{code}
\end{code}
@@
-638,8
+637,7
@@
getLinkDeps hsc_env hpt _ maybe_normal_osuf span mods
get_linkable maybe_normal_osuf mod_name -- A home-package module
| Just mod_info <- lookupUFM hpt mod_name
get_linkable maybe_normal_osuf mod_name -- A home-package module
| Just mod_info <- lookupUFM hpt mod_name
- = ASSERT(isJust (hm_linkable mod_info))
- adjust_linkable (fromJust (hm_linkable mod_info))
+ = adjust_linkable (Maybes.expectJust "getLinkDeps" (hm_linkable mod_info))
| otherwise
= do -- It's not in the HPT because we are in one shot mode,
-- so use the Finder to get a ModLocation...
| otherwise
= do -- It's not in the HPT because we are in one shot mode,
-- so use the Finder to get a ModLocation...
diff --git
a/compiler/main/PackageConfig.hs
b/compiler/main/PackageConfig.hs
index
1602429
..
a3fd027
100644
(file)
--- a/
compiler/main/PackageConfig.hs
+++ b/
compiler/main/PackageConfig.hs
@@
-21,7
+21,7
@@
module PackageConfig (
#include "HsVersions.h"
#include "HsVersions.h"
-import Data.Maybe
+import Maybes
import Module
import Distribution.InstalledPackageInfo
import Distribution.ModuleName
import Module
import Distribution.InstalledPackageInfo
import Distribution.ModuleName
@@
-80,7
+80,7
@@
packageConfigToInstalledPackageInfo
pkgconf{ exposedModules = map convert e,
hiddenModules = map convert h }
where convert :: Module.ModuleName -> Distribution.ModuleName.ModuleName
pkgconf{ exposedModules = map convert e,
hiddenModules = map convert h }
where convert :: Module.ModuleName -> Distribution.ModuleName.ModuleName
- convert = fromJust . simpleParse . moduleNameString
+ convert = (expectJust "packageConfigToInstalledPackageInfo") . simpleParse . moduleNameString
-- | Turn an 'InstalledPackageInfo', which contains Cabal 'Distribution.ModuleName.ModuleName's
-- into a GHC specific 'PackageConfig' which contains GHC 'Module.ModuleName's
-- | Turn an 'InstalledPackageInfo', which contains Cabal 'Distribution.ModuleName.ModuleName's
-- into a GHC specific 'PackageConfig' which contains GHC 'Module.ModuleName's
diff --git
a/compiler/typecheck/FamInst.lhs
b/compiler/typecheck/FamInst.lhs
index
67c526d
..
5f4b2a3
100644
(file)
--- a/
compiler/typecheck/FamInst.lhs
+++ b/
compiler/typecheck/FamInst.lhs
@@
-20,7
+20,7
@@
import LazyUniqFM
import FiniteMap
import FastString
import FiniteMap
import FastString
-import Maybe
+import Maybes
import Monad
\end{code}
import Monad
\end{code}
@@
-117,8
+117,8
@@
checkFamInstConsistency famInstMods directlyImpMods
-- already loaded in the EPS or they are in the HPT.
--
check modInstsEnv (ModulePair m1 m2)
-- already loaded in the EPS or they are in the HPT.
--
check modInstsEnv (ModulePair m1 m2)
- = let { instEnv1 = fromJust . lookupModuleEnv modInstsEnv $ m1
- ; instEnv2 = fromJust . lookupModuleEnv modInstsEnv $ m2
+ = let { instEnv1 = (expectJust "checkFamInstConsistency") . lookupModuleEnv modInstsEnv $ m1
+ ; instEnv2 = (expectJust "checkFamInstConsistency") . lookupModuleEnv modInstsEnv $ m2
; insts1 = famInstEnvElts instEnv1
}
in
; insts1 = famInstEnvElts instEnv1
}
in