Kill nameSetElems in rnCmdTop
authorBartosz Nitka <niteria@gmail.com>
Thu, 2 Jun 2016 18:38:11 +0000 (11:38 -0700)
committerBartosz Nitka <niteria@gmail.com>
Thu, 2 Jun 2016 19:49:29 +0000 (12:49 -0700)
This change isn't necessary for determinism. appAName, choiceAName,
loopAName all have pre-allocated Uniques and their relative order
can't change. I opted to use nameSetElemsStable here because:
* the cost is negligible
* it's less fragile than just documenting

Test Plan: ./validate

Reviewers: simonpj, austin, bgamari, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2292

GHC Trac Issues: #4012

compiler/rename/RnExpr.hs

index af58135..32277b4 100644 (file)
@@ -441,7 +441,7 @@ rnCmdTop = wrapLocFstM rnCmdTop'
   rnCmdTop' (HsCmdTop cmd _ _ _)
    = do { (cmd', fvCmd) <- rnLCmd cmd
         ; let cmd_names = [arrAName, composeAName, firstAName] ++
-                          nameSetElems (methodNamesCmd (unLoc cmd'))
+                          nameSetElemsStable (methodNamesCmd (unLoc cmd'))
         -- Generate the rebindable syntax for the monad
         ; (cmd_names', cmd_fvs) <- lookupSyntaxNames cmd_names