projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Another tiny tidy-up to RnPat
[ghc-hetmet.git]
/
compiler
/
rename
/
RnSource.lhs
diff --git
a/compiler/rename/RnSource.lhs
b/compiler/rename/RnSource.lhs
index
e2adb33
..
bbf4938
100644
(file)
--- a/
compiler/rename/RnSource.lhs
+++ b/
compiler/rename/RnSource.lhs
@@
-21,11
+21,10
@@
import RnBinds ( rnTopBindsLHS, rnTopBindsRHS, rnMethodBinds, renameSigs, mkSig
makeMiniFixityEnv)
import RnEnv ( lookupLocalDataTcNames, lookupLocatedOccRn,
lookupTopBndrRn, lookupLocatedTopBndrRn,
makeMiniFixityEnv)
import RnEnv ( lookupLocalDataTcNames, lookupLocatedOccRn,
lookupTopBndrRn, lookupLocatedTopBndrRn,
- lookupOccRn, newLocalsRn,
+ lookupOccRn, newLocalBndrsRn,
bindLocatedLocalsFV, bindPatSigTyVarsFV,
bindTyVarsRn, extendTyVarEnvFVRn,
bindLocatedLocalsFV, bindPatSigTyVarsFV,
bindTyVarsRn, extendTyVarEnvFVRn,
- bindLocalNames, checkDupRdrNames, mapFvRn,
- checkM
+ bindLocalNames, checkDupRdrNames, mapFvRn
)
import RnNames ( getLocalNonValBinders, extendGlobalRdrEnvRn )
import HscTypes ( GenAvailInfo(..), availsToNameSet )
)
import RnNames ( getLocalNonValBinders, extendGlobalRdrEnvRn )
import HscTypes ( GenAvailInfo(..), availsToNameSet )
@@
-42,12
+41,12
@@
import Bag
import FastString
import SrcLoc
import DynFlags ( DynFlag(..) )
import FastString
import SrcLoc
import DynFlags ( DynFlag(..) )
-import Maybe ( isNothing )
import BasicTypes ( Boxity(..) )
import ListSetOps (findDupsEq)
import Control.Monad
import BasicTypes ( Boxity(..) )
import ListSetOps (findDupsEq)
import Control.Monad
+import Data.Maybe
\end{code}
\begin{code}
\end{code}
\begin{code}
@@
-634,9
+633,9
@@
However, we can also do some scoping checks at the same time.
\begin{code}
rnTyClDecl :: TyClDecl RdrName -> RnM (TyClDecl Name, FreeVars)
\begin{code}
rnTyClDecl :: TyClDecl RdrName -> RnM (TyClDecl Name, FreeVars)
-rnTyClDecl (ForeignType {tcdLName = name, tcdFoType = fo_type, tcdExtName = ext_name})
+rnTyClDecl (ForeignType {tcdLName = name, tcdExtName = ext_name})
= lookupLocatedTopBndrRn name `thenM` \ name' ->
= lookupLocatedTopBndrRn name `thenM` \ name' ->
- return (ForeignType {tcdLName = name', tcdFoType = fo_type, tcdExtName = ext_name},
+ return (ForeignType {tcdLName = name', tcdExtName = ext_name},
emptyFVs)
-- all flavours of type family declarations ("type family", "newtype fanily",
emptyFVs)
-- all flavours of type family declarations ("type family", "newtype fanily",
@@
-779,7
+778,7
@@
rnTyClDecl (ClassDecl {tcdCtxt = context, tcdLName = cname,
-- No need to check for duplicate method signatures
-- since that is done by RnNames.extendGlobalRdrEnvRn
-- and the methods are already in scope
-- No need to check for duplicate method signatures
-- since that is done by RnNames.extendGlobalRdrEnvRn
-- and the methods are already in scope
- ; gen_tyvars <- newLocalsRn gen_rdr_tyvars_w_locs
+ ; gen_tyvars <- newLocalBndrsRn gen_rdr_tyvars_w_locs
; rnMethodBinds (unLoc cname') (mkSigTvFn sigs') gen_tyvars mbinds }
-- Haddock docs
; rnMethodBinds (unLoc cname') (mkSigTvFn sigs') gen_tyvars mbinds }
-- Haddock docs
@@
-945,7
+944,7
@@
rnATs ats = mapFvRn (wrapLocFstM rn_at) ats
rn_at (tydecl@TyFamily {}) = rnFamily tydecl lookupIdxVars
rn_at (tydecl@TySynonym {}) =
do
rn_at (tydecl@TyFamily {}) = rnFamily tydecl lookupIdxVars
rn_at (tydecl@TySynonym {}) =
do
- checkM (isNothing (tcdTyPats tydecl)) $ addErr noPatterns
+ unless (isNothing (tcdTyPats tydecl)) $ addErr noPatterns
rnTyClDecl tydecl
rn_at _ = panic "RnSource.rnATs: invalid TyClDecl"
rnTyClDecl tydecl
rn_at _ = panic "RnSource.rnATs: invalid TyClDecl"