summaryrefslogtreecommitdiff
path: root/compiler/specialise/Rules.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-05-12 08:01:34 -0700
committerBartosz Nitka <niteria@gmail.com>2016-05-12 09:34:08 -0700
commit5416fadb7387cbe89752faa875b2dade60655cf2 (patch)
treef320b60f572746a920dda5906c129e9deeafa591 /compiler/specialise/Rules.hs
parent7c0b595e55d31f9f89e6dede11981e942c5bb32f (diff)
downloadhaskell-5416fadb7387cbe89752faa875b2dade60655cf2.tar.gz
Refactor some ppr functions to use pprUFM
Nondeterminism doesn't matter in these places and pprUFM makes it obvious. I've flipped the order of arguments for convenience. Test Plan: ./validate Reviewers: simonmar, bgamari, austin, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2205 GHC Trac Issues: #4012
Diffstat (limited to 'compiler/specialise/Rules.hs')
-rw-r--r--compiler/specialise/Rules.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index f9f195fe45..aebfbc744e 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -50,6 +50,7 @@ import VarSet
import Name ( Name, NamedThing(..), nameIsLocalOrFrom )
import NameSet
import NameEnv
+import UniqFM
import Unify ( ruleMatchTyX )
import BasicTypes ( Activation, CompilerPhase, isActive, pprRuleName )
import StaticFlags ( opt_PprStyle_Debug )
@@ -357,8 +358,9 @@ extendRuleBase rule_base rule
= extendNameEnv_Acc (:) singleton rule_base (ruleIdName rule) rule
pprRuleBase :: RuleBase -> SDoc
-pprRuleBase rules = vcat [ pprRules (tidyRules emptyTidyEnv rs)
- | rs <- nameEnvElts rules ]
+pprRuleBase rules = pprUFM rules $ \rss ->
+ vcat [ pprRules (tidyRules emptyTidyEnv rs)
+ | rs <- rss ]
{-
************************************************************************