[commit: ghc] master: RnNames.lhs : Reuse existing function. (fd9a9ab)

git at git.haskell.org git at git.haskell.org
Sat Sep 28 05:21:05 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/fd9a9abf106c97cfeff220c9f4087537bf192ef3/ghc

>---------------------------------------------------------------

commit fd9a9abf106c97cfeff220c9f4087537bf192ef3
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sat Sep 28 04:50:54 2013 +1000

    RnNames.lhs : Reuse existing function.


>---------------------------------------------------------------

fd9a9abf106c97cfeff220c9f4087537bf192ef3
 compiler/rename/RnNames.lhs |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs
index c960343..d8c92eb 100644
--- a/compiler/rename/RnNames.lhs
+++ b/compiler/rename/RnNames.lhs
@@ -1081,11 +1081,8 @@ exports_from_avail (Just rdr_items) rdr_env imports this_mod
     lookup_ie (IEThingAbs rdr)
         = do gre <- lookupGreRn rdr
              let name = gre_name gre
-             case gre_par gre of
-                NoParent   -> return (IEThingAbs name,
-                                      AvailTC name [name])
-                ParentIs p -> return (IEThingAbs name,
-                                      AvailTC p [name])
+                 avail = greExportAvail gre
+             return (IEThingAbs name, avail)
 
     lookup_ie ie@(IEThingAll rdr)
         = do name <- lookupGlobalOccRn rdr
@@ -1408,11 +1405,7 @@ extendImportMap rdr_env rdr imp_map
         add _ avails = avail : avails -- add is really just a specialised (++)
         decl_loc = srcSpanEnd (is_dloc imp_decl_spec)
                    -- For srcSpanEnd see Note [The ImportMap]
-        name     = gre_name gre
-        avail    = case gre_par gre of
-                      ParentIs p                  -> AvailTC p [name]
-                      NoParent | isTyConName name -> AvailTC name [name]
-                               | otherwise        -> Avail name
+        avail    = greExportAvail gre
 
     bestImport :: [ImportSpec] -> ImportSpec
     bestImport iss




More information about the ghc-commits mailing list