[commit: ghc] master: Document determinism in pprintClosureCommand (3b698e8)

git at git.haskell.org git at git.haskell.org
Tue Jun 7 14:32:06 UTC 2016


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

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

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

commit 3b698e8938ccfa3e0dbf192abf4984d6937a196e
Author: Bartosz Nitka <niteria at gmail.com>
Date:   Tue Jun 7 07:33:45 2016 -0700

    Document determinism in pprintClosureCommand
    
    Like described in the comment, it's OK here.
    
    GHC Trac: #4012


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

3b698e8938ccfa3e0dbf192abf4984d6937a196e
 compiler/ghci/Debugger.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/ghci/Debugger.hs b/compiler/ghci/Debugger.hs
index acc900f..64ac154 100644
--- a/compiler/ghci/Debugger.hs
+++ b/compiler/ghci/Debugger.hs
@@ -26,6 +26,7 @@ import IfaceEnv( newInteractiveBinder )
 import Name
 import Var hiding ( varName )
 import VarSet
+import UniqFM
 import Type
 import Kind
 import GHC
@@ -99,7 +100,9 @@ pprintClosureCommand bindThings force str = do
          my_tvs       = termTyCoVars t
          tvs          = env_tvs `minusVarSet` my_tvs
          tyvarOccName = nameOccName . tyVarName
-         tidyEnv      = (initTidyOccEnv (map tyvarOccName (varSetElems tvs))
+         tidyEnv      = (initTidyOccEnv (map tyvarOccName (nonDetEltsUFM tvs))
+           -- It's OK to use nonDetEltsUFM here because initTidyOccEnv
+           -- forgets the ordering immediately by creating an env
                         , env_tvs `intersectVarSet` my_tvs)
      return$ mapTermType (snd . tidyOpenType tidyEnv) t
 



More information about the ghc-commits mailing list