Skip to content
Snippets Groups Projects
Commit f69bf6be authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
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