diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-05-22 14:33:16 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-05-22 15:05:21 +0100 |
commit | 369dd0c61ad7b95076584016c2492594cb73cf5b (patch) | |
tree | fc80c78a816758554523b6bbeb6a6c19ab7f3e1d /compiler | |
parent | c488da851c39ca202cdd056091176acbabdd7dd4 (diff) | |
download | haskell-369dd0c61ad7b95076584016c2492594cb73cf5b.tar.gz |
White space layout only
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/TidyPgm.hs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs index 1c72130365..e9dd8d1c4a 100644 --- a/compiler/main/TidyPgm.hs +++ b/compiler/main/TidyPgm.hs @@ -1039,25 +1039,25 @@ tidyTopName mod nc_var maybe_ref occ_env id loc = nameSrcSpan name old_occ = nameOccName name - new_occ - | Just ref <- maybe_ref, ref /= id = - mkOccName (occNameSpace old_occ) $ - let - ref_str = occNameString (getOccName ref) - occ_str = occNameString old_occ - in - case occ_str of - '$':'w':_ -> occ_str - -- workers: the worker for a function already - -- includes the occname for its parent, so there's - -- no need to prepend the referrer. - _other | isSystemName name -> ref_str - | otherwise -> ref_str ++ '_' : occ_str - -- If this name was system-generated, then don't bother - -- to retain its OccName, just use the referrer. These - -- system-generated names will become "f1", "f2", etc. for - -- a referrer "f". - | otherwise = old_occ + new_occ | Just ref <- maybe_ref + , ref /= id + = mkOccName (occNameSpace old_occ) $ + let + ref_str = occNameString (getOccName ref) + occ_str = occNameString old_occ + in + case occ_str of + '$':'w':_ -> occ_str + -- workers: the worker for a function already + -- includes the occname for its parent, so there's + -- no need to prepend the referrer. + _other | isSystemName name -> ref_str + | otherwise -> ref_str ++ '_' : occ_str + -- If this name was system-generated, then don't bother + -- to retain its OccName, just use the referrer. These + -- system-generated names will become "f1", "f2", etc. for + -- a referrer "f". + | otherwise = old_occ (occ_env', occ') = tidyOccName occ_env new_occ |