[commit: ghc] wip/T9732: Simplify creation of IDs (7da3053)

git at git.haskell.org git at git.haskell.org
Thu Nov 6 13:11:09 UTC 2014


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

On branch  : wip/T9732
Link       : http://ghc.haskell.org/trac/ghc/changeset/7da3053d3fbf6f3dcc12dd5df709083aed9cdfed/ghc

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

commit 7da3053d3fbf6f3dcc12dd5df709083aed9cdfed
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Thu Nov 6 20:27:54 2014 +0800

    Simplify creation of IDs


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

7da3053d3fbf6f3dcc12dd5df709083aed9cdfed
 compiler/typecheck/TcPatSyn.lhs | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/compiler/typecheck/TcPatSyn.lhs b/compiler/typecheck/TcPatSyn.lhs
index 398acca..afab369 100644
--- a/compiler/typecheck/TcPatSyn.lhs
+++ b/compiler/typecheck/TcPatSyn.lhs
@@ -24,7 +24,6 @@ import Outputable
 import FastString
 import Var
 import Id
-import IdInfo( IdDetails( VanillaId ) )
 import TcBinds
 import BasicTypes
 import TcSimplify
@@ -138,7 +137,7 @@ tcPatSynMatcher (L loc name) lpat args univ_tvs ex_tvs ev_binds prov_dicts req_d
 
        ; let matcher_tau = mkFunTys [pat_ty, cont_ty, fail_ty] res_ty
              matcher_sigma = mkSigmaTy (res_tv:univ_tvs) req_theta matcher_tau
-             matcher_id = mkExportedLocalId VanillaId matcher_name matcher_sigma
+             matcher_id = mkVanillaGlobal matcher_name matcher_sigma
 
        ; traceTc "tcPatSynMatcher" (ppr name $$ ppr (idType matcher_id))
        ; let matcher_lid = L loc matcher_id
@@ -190,9 +189,7 @@ tcPatSynMatcher (L loc name) lpat args univ_tvs ex_tvs ev_binds prov_dicts req_d
 
        ; return (matcher_id, matcher_bind) }
   where
-    mkId s ty = do
-        name <- newName . mkVarOccFS . fsLit $ s
-        return $ mkLocalId name ty
+    mkId s ty = mkSysLocalM (fsLit s) ty
 
 isBidirectional :: HsPatSynDir a -> Bool
 isBidirectional Unidirectional = False
@@ -233,7 +230,7 @@ mkPatSynWrapperId (L _ name) args univ_tvs ex_tvs theta pat_ty
              wrapper_sigma = mkSigmaTy wrapper_tvs wrapper_theta wrapper_tau
 
        ; wrapper_name <- newImplicitBinder name mkDataConWrapperOcc
-       ; return $ mkExportedLocalId VanillaId wrapper_name wrapper_sigma }
+       ; return $ mkVanillaGlobal wrapper_name wrapper_sigma }
 
 mkPatSynWrapper :: Located Name
                 -> MatchGroup Name (LHsExpr Name)



More information about the ghc-commits mailing list