[commit: ghc] master: Expand the comment on pprVarSet (fa3ba06)

git at git.haskell.org git at git.haskell.org
Thu Apr 28 12:34:02 UTC 2016


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

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

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

commit fa3ba060cdc7f469e7f5c4f7503fadfe99937c90
Author: Bartosz Nitka <niteria at gmail.com>
Date:   Thu Apr 28 05:35:31 2016 -0700

    Expand the comment on pprVarSet


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

fa3ba060cdc7f469e7f5c4f7503fadfe99937c90
 compiler/basicTypes/VarSet.hs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/basicTypes/VarSet.hs b/compiler/basicTypes/VarSet.hs
index 6021fdf..f61bbbe 100644
--- a/compiler/basicTypes/VarSet.hs
+++ b/compiler/basicTypes/VarSet.hs
@@ -183,6 +183,11 @@ pluralVarSet = pluralUFM
 -- shouldn't be a problem.
 -- Having this function helps contain the non-determinism created with
 -- varSetElems.
+-- Passing a list to the pretty-printing function allows the caller
+-- to decide on the order of Vars (eg. toposort them) without them having
+-- to use varSetElems at the call site. This prevents from let-binding
+-- non-deterministically ordered lists and reusing them where determinism
+-- matters.
 pprVarSet :: ([Var] -> SDoc) -- ^ The pretty printing function to use on the
                              -- elements
           -> VarSet          -- ^ The things to be pretty printed



More information about the ghc-commits mailing list