Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name conflict in buildStgName #411

Open
phi16 opened this issue Sep 19, 2017 · 1 comment
Open

Name conflict in buildStgName #411

phi16 opened this issue Sep 19, 2017 · 1 comment

Comments

@phi16
Copy link
Contributor

phi16 commented Sep 19, 2017

In

buildStgName :: Name -> Builder
(buildStgName
function) , I suspected that the operator (*) and (-) will be mangled to same symbol...

Actually in my case, instance Num (Var String) generates following codes (with --debug option) :

_6P/* $fNumVar_$c* */ = function(_6Q/* s4S9 */, _6R/* s4Sa */){
  return new T1(1,new T2(1,_1Q/* Main.$c+5 */,new T2(1,_6Q/* s4S9 */,new T2(1,_6O/* Main.$fNumVar5 */,new T2(1,_6R/* s4Sa */,_G/* Main.lvl5 */)))));
},
...,
_6W/* $fNumVar_$c- */ = function(_6X/* s4Sl */, _6Y/* s4Sm */){
  return new F(function(){return A3(_6S/* GHC.Num.+ */,_6Z/* Main.$fNumVar */, _6X/* s4Sl */, new T(function(){
    return B(A2(_6U/* GHC.Num.negate */,_6Z/* Main.$fNumVar */, _6Y/* s4Sm */));
  }));});
},

but these cause name conflict on compiling with an option --preserve-names

$hs$Main$$fNumVar_$c_ = function($hs$Main$s4S9, $hs$Main$s4Sa){
  return new T1(1,new T2(1,$hs$Main$$c_5,new T2(1,$hs$Main$s4S9,new T2(1,$hs$Main$$fNumVar5,new T2(1,$hs$Main$s4Sa,$hs$Main$lvl5)))));
},
...,
$hs$Main$$fNumVar_$c_ = function($hs$Main$s4Sl, $hs$Main$s4Sm){
  return new F(function(){return A3($hs$GHC_Num$_,$hs$Main$$fNumVar, $hs$Main$s4Sl, new T(function(){
    return B(A2($hs$GHC_Num$negate,$hs$Main$$fNumVar, $hs$Main$s4Sm));
  }));});
},

I want to use --preserve-names to profile my program :D
I'm using x86_64-windows-haste-0.6.0.0-ghc-7.10.2.

Thanks.

@phi16
Copy link
Contributor Author

phi16 commented Sep 20, 2017

Note : it seems that >>= and <*> are mangled to $hs$GHC_Base$___ and causing a conflict too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant