Skip to content
Snippets Groups Projects
Commit 2e1a0cb7 authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by pcapriotti
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

MERGED from commit bdce8f0a
parent c70ca5b5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment