[commit: ghc] wip/generics-propeq: fix the creation of constructor names (43c3228)

git at git.haskell.org git at git.haskell.org
Sun Jun 29 12:40:39 UTC 2014


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

On branch  : wip/generics-propeq
Link       : http://ghc.haskell.org/trac/ghc/changeset/43c3228ab5fbaa5c5a7f1fc14ca532c4a7a9f0ee/ghc

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

commit 43c3228ab5fbaa5c5a7f1fc14ca532c4a7a9f0ee
Author: Gabor Greif <ggreif at gmail.com>
Date:   Sun Jun 29 14:38:16 2014 +0200

    fix the creation of constructor names


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

43c3228ab5fbaa5c5a7f1fc14ca532c4a7a9f0ee
 compiler/typecheck/TcGenGenerics.lhs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/compiler/typecheck/TcGenGenerics.lhs b/compiler/typecheck/TcGenGenerics.lhs
index 1e4d42b..c601a85 100644
--- a/compiler/typecheck/TcGenGenerics.lhs
+++ b/compiler/typecheck/TcGenGenerics.lhs
@@ -79,7 +79,7 @@ genGenericMetaTyCons tc mod =
         tc_arits  = map dataConSourceArity tc_cons
 
         tc_occ    = nameOccName tc_name
-        c_occ m   = mkGenC tc_occ m
+        --c_occ m   = mkGenC tc_occ m
         s_occ m n = mkGenS tc_occ m n
 
         mkTyCon tyvars name = ASSERT( isExternalName name )
@@ -92,8 +92,10 @@ genGenericMetaTyCons tc mod =
       d_tycon  <- tcLookupTyCon datTyConName
       let d_type = mkTyConApp d_tycon $ map (LitTy . StrTyLit)
                     [moduleNameFS . moduleName $ mod, occNameFS . nameOccName $ tc_name]
-      c_names <- forM (zip [0..] tc_cons) $ \(m,_) ->
-                    newGlobalBinder mod (c_occ m) loc
+      --c_names <- forM (zip [0..] tc_cons) $ \(m,_) ->
+      --              newGlobalBinder mod (c_occ m) loc
+      --let c_names = flip map (zip [0..] tc_cons) $ \(m,con) -> getName con
+      let c_names = map getName tc_cons
       s_names <- forM (zip [0..] tc_arits) $ \(m,a) -> forM [0..a-1] $ \n ->
                     newGlobalBinder mod (s_occ m n) loc
 



More information about the ghc-commits mailing list