Commit 1394c624 authored by simonpj's avatar simonpj
Browse files

[project @ 2001-12-11 12:19:04 by simonpj]

Dead code removal
parent 5f35df7f
...@@ -611,20 +611,12 @@ bindTyVarsRn :: SDoc -> [HsTyVarBndr RdrName] ...@@ -611,20 +611,12 @@ bindTyVarsRn :: SDoc -> [HsTyVarBndr RdrName]
-> ([HsTyVarBndr Name] -> RnMS a) -> ([HsTyVarBndr Name] -> RnMS a)
-> RnMS a -> RnMS a
bindTyVarsRn doc_str tyvar_names enclosed_scope bindTyVarsRn doc_str tyvar_names enclosed_scope
= bindTyVars2Rn doc_str tyvar_names $ \ names tyvars ->
enclosed_scope tyvars
-- Gruesome name: return Names as well as HsTyVars
bindTyVars2Rn :: SDoc -> [HsTyVarBndr RdrName]
-> ([Name] -> [HsTyVarBndr Name] -> RnMS a)
-> RnMS a
bindTyVars2Rn doc_str tyvar_names enclosed_scope
= getSrcLocRn `thenRn` \ loc -> = getSrcLocRn `thenRn` \ loc ->
let let
located_tyvars = [(hsTyVarName tv, loc) | tv <- tyvar_names] located_tyvars = [(hsTyVarName tv, loc) | tv <- tyvar_names]
in in
bindLocatedLocalsRn doc_str located_tyvars $ \ names -> bindLocatedLocalsRn doc_str located_tyvars $ \ names ->
enclosed_scope names (zipWith replaceTyVarName tyvar_names names) enclosed_scope (zipWith replaceTyVarName tyvar_names names)
bindPatSigTyVars :: [RdrNameHsType] bindPatSigTyVars :: [RdrNameHsType]
-> RnMS (a, FreeVars) -> RnMS (a, FreeVars)
......
...@@ -25,8 +25,7 @@ import RnBinds ( rnTopBinds, rnMethodBinds, renameSigs, renameSigsFVs ) ...@@ -25,8 +25,7 @@ import RnBinds ( rnTopBinds, rnMethodBinds, renameSigs, renameSigsFVs )
import RnEnv ( lookupTopBndrRn, lookupOccRn, lookupIfaceName, import RnEnv ( lookupTopBndrRn, lookupOccRn, lookupIfaceName,
lookupOrigNames, lookupSysBinder, newLocalsRn, lookupOrigNames, lookupSysBinder, newLocalsRn,
bindLocalsFVRn, bindPatSigTyVars, bindLocalsFVRn, bindPatSigTyVars,
bindTyVarsRn, bindTyVars2Rn, bindTyVarsRn, extendTyVarEnvFVRn,
extendTyVarEnvFVRn,
bindCoreLocalRn, bindCoreLocalsRn, bindLocalNames, bindCoreLocalRn, bindCoreLocalsRn, bindLocalNames,
checkDupOrQualNames, checkDupNames, mapFvRn checkDupOrQualNames, checkDupNames, mapFvRn
) )
...@@ -341,7 +340,7 @@ rnTyClDecl (ClassDecl {tcdCtxt = context, tcdName = cname, ...@@ -341,7 +340,7 @@ rnTyClDecl (ClassDecl {tcdCtxt = context, tcdName = cname,
mapRn lookupSysBinder names `thenRn` \ names' -> mapRn lookupSysBinder names `thenRn` \ names' ->
-- Tyvars scope over bindings and context -- Tyvars scope over bindings and context
bindTyVars2Rn cls_doc tyvars $ \ clas_tyvar_names tyvars' -> bindTyVarsRn cls_doc tyvars $ \ tyvars' ->
-- Check the superclasses -- Check the superclasses
rnContext cls_doc context `thenRn` \ context' -> rnContext cls_doc context `thenRn` \ context' ->
...@@ -355,8 +354,8 @@ rnTyClDecl (ClassDecl {tcdCtxt = context, tcdName = cname, ...@@ -355,8 +354,8 @@ rnTyClDecl (ClassDecl {tcdCtxt = context, tcdName = cname,
(op_sigs, non_op_sigs) = partition isClassOpSig sigs (op_sigs, non_op_sigs) = partition isClassOpSig sigs
sig_rdr_names_w_locs = [(op,locn) | ClassOpSig op _ _ locn <- sigs] sig_rdr_names_w_locs = [(op,locn) | ClassOpSig op _ _ locn <- sigs]
in in
checkDupOrQualNames sig_doc sig_rdr_names_w_locs `thenRn_` checkDupOrQualNames sig_doc sig_rdr_names_w_locs `thenRn_`
mapRn (rnClassOp cname' clas_tyvar_names fds') op_sigs `thenRn` \ sigs' -> mapRn (rnClassOp cname' fds') op_sigs `thenRn` \ sigs' ->
let let
binders = mkNameSet [ nm | (ClassOpSig nm _ _ _) <- sigs' ] binders = mkNameSet [ nm | (ClassOpSig nm _ _ _) <- sigs' ]
in in
...@@ -374,7 +373,7 @@ rnTyClDecl (ClassDecl {tcdCtxt = context, tcdName = cname, ...@@ -374,7 +373,7 @@ rnTyClDecl (ClassDecl {tcdCtxt = context, tcdName = cname,
cls_doc = text "In the declaration for class" <+> ppr cname cls_doc = text "In the declaration for class" <+> ppr cname
sig_doc = text "In the signatures for class" <+> ppr cname sig_doc = text "In the signatures for class" <+> ppr cname
rnClassOp clas clas_tyvars clas_fds sig@(ClassOpSig op dm_stuff ty locn) rnClassOp clas clas_fds sig@(ClassOpSig op dm_stuff ty locn)
= pushSrcLocRn locn $ = pushSrcLocRn locn $
lookupTopBndrRn op `thenRn` \ op_name -> lookupTopBndrRn op `thenRn` \ op_name ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment