diff --git a/compiler/coreSyn/MkCore.lhs b/compiler/coreSyn/MkCore.lhs
index 410d62db7dd5af1254a332aab4676f9a54993f4b..cd47d664411be01308cdbe29a70e2351e9d0370d 100644
--- a/compiler/coreSyn/MkCore.lhs
+++ b/compiler/coreSyn/MkCore.lhs
@@ -102,14 +102,14 @@ infixl 4 `mkCoreApp`, `mkCoreApps`
 \begin{code}
 sortQuantVars :: [Var] -> [Var]
 -- Sort the variables (KindVars, TypeVars, and Ids) 
--- into order: Type, then Kind, then Id
+-- into order: Kind, then Type, then Id
 sortQuantVars = sortBy (comparing withCategory)
   where
     withCategory v = (category v, v)
     category :: Var -> Int
     category v
-     | isTyVar   v = 1
-     | isKindVar v = 2
+     | isKindVar v = 1
+     | isTyVar   v = 2
      | otherwise   = 3
 
 -- | Bind a binding group over an expression, using a @let@ or @case@ as