rmCodeFromMod pns fileName (mod, tokList) destModName destFileName
  = runStateT (do -- remove the definition.
                  decls'<-rmDecl (ghead "rmCodeFromMod"  pns) True (hsDecls mod)  
                  -- remove the definition name from the export list
                  mod'<-rmItemsFromExport (replaceDecls mod decls') (Left ([],pns))
                  -- is the definition used in the current module?
                  if isUsedByMod pns mod' 
                    then -- yes. add the definition name to the import.
                         do let qual=getQualifier destModName mod' 
                            mod''<-replaceQualifier pns qual mod' 
                            addImport destFileName destModName pns mod''
                    else --No, do nothing.
                         return mod') 
             ((tokList,unmodified),(-1000,0))
rmCodeFromMod pns fileName (mod, tokList) destModName destFileName
  = runStateT (do -- remove the definition.
                  decls'<-rmDecl (ghead "rmCodeFromMod"  pns) True (hsDecls mod)  
                  -- remove the definition name from the export list
                  mod'<-rmItemsFromExport (replaceDecls mod decls') (Left ([],pns))
                  -- is the definition used in the current module?
                  if isUsedByMod pns mod' 
                    then -- yes. add the definition name to the import.
                         do let qual=getQualifier destModName mod' 
                            mod''<-replaceQualifier pns qual mod' 
                            addImport destFileName destModName pns mod''
                    else --No, do nothing.
                         return mod') 
             ((tokList,unmodified),(-1000,0))
rmCodeFromMod pns fileName (mod, tokList) destModName destFileName
  = runStateT (do -- remove the definition.
                  decls'<-rmDecl (ghead "rmCodeFromMod"  pns) True (hsDecls mod)  
                  -- remove the definition name from the export list
                  mod'<-rmItemsFromExport (replaceDecls mod decls') (Left ([],pns))
                  -- is the definition used in the current module?
                  if isUsedByMod pns mod' 
                    then -- yes. add the definition name to the import.
                         do let qual=getQualifier destModName mod' 
                            mod''<-replaceQualifier pns qual mod' 
                            addImport destFileName destModName pns mod''
                    else --No, do nothing.
                         return mod') 
             ((tokList,unmodified),(-1000,0))