Commit f69bf6be authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Fix Trac #3920: Template Haskell kinds

Fix two places where we were doing foldl instead of foldr
after decomposing a Kind.  Strange that the same bug appears
in two quite different places!
parent 1a050f3c
......@@ -644,7 +644,7 @@ repKind ki
= do { let (kis, ki') = splitKindFunTys ki
; kis_rep <- mapM repKind kis
; ki'_rep <- repNonArrowKind ki'
; foldlM repArrowK ki'_rep kis_rep
; foldrM repArrowK ki'_rep kis_rep
}
where
repNonArrowKind k | isLiftedTypeKind k = repStarK
......
......@@ -1119,7 +1119,7 @@ reifyKind ki
kis_rep = map reifyKind kis
ki'_rep = reifyNonArrowKind ki'
in
foldl TH.ArrowK ki'_rep kis_rep
foldr TH.ArrowK ki'_rep kis_rep
where
reifyNonArrowKind k | isLiftedTypeKind k = TH.StarK
| otherwise = pprPanic "Exotic form of kind"
......
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