Commit bdce8f0a authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Put kind variables before type variables when quantifying

This is a pretty egregious error; I'm surprised it has lasted so long!

Fixes Trac #7124
parent c848891a
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment