[commit: ghc] master: Comments only, on Type.topSortTyVars (f0e331b)

git at git.haskell.org git at git.haskell.org
Fri Apr 15 15:31:06 UTC 2016


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

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

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

commit f0e331bd9233669ef615f67e0b9e886b2ff13850
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Apr 8 17:29:41 2016 +0100

    Comments only, on Type.topSortTyVars


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

f0e331bd9233669ef615f67e0b9e886b2ff13850
 compiler/types/Type.hs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs
index 8901968..57cd64a 100644
--- a/compiler/types/Type.hs
+++ b/compiler/types/Type.hs
@@ -1857,8 +1857,13 @@ typeSize (CoercionTy co)  = coercionSize co
 ************************************************************************
 -}
 
--- | Do a topological sort on a list of tyvars. This is a deterministic
--- sorting operation (that is, doesn't depend on Uniques).
+-- | Do a topological sort on a list of tyvars,
+--   so that binders occur before occurrences
+-- E.g. given  [ a::k, k::*, b::k ]
+-- it'll return a well-scoped list [ k::*, a::k, b::k ]
+--
+-- This is a deterministic sorting operation
+-- (that is, doesn't depend on Uniques).
 toposortTyVars :: [TyVar] -> [TyVar]
 toposortTyVars tvs = reverse $
                      [ tv | (tv, _, _) <- topologicalSortG $



More information about the ghc-commits mailing list