Commit f69bf6be authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
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
...@@ -644,7 +644,7 @@ repKind ki ...@@ -644,7 +644,7 @@ repKind ki
= do { let (kis, ki') = splitKindFunTys ki = do { let (kis, ki') = splitKindFunTys ki
; kis_rep <- mapM repKind kis ; kis_rep <- mapM repKind kis
; ki'_rep <- repNonArrowKind ki' ; ki'_rep <- repNonArrowKind ki'
; foldlM repArrowK ki'_rep kis_rep ; foldrM repArrowK ki'_rep kis_rep
} }
where where
repNonArrowKind k | isLiftedTypeKind k = repStarK repNonArrowKind k | isLiftedTypeKind k = repStarK
......
...@@ -1119,7 +1119,7 @@ reifyKind ki ...@@ -1119,7 +1119,7 @@ reifyKind ki
kis_rep = map reifyKind kis kis_rep = map reifyKind kis
ki'_rep = reifyNonArrowKind ki' ki'_rep = reifyNonArrowKind ki'
in in
foldl TH.ArrowK ki'_rep kis_rep foldr TH.ArrowK ki'_rep kis_rep
where where
reifyNonArrowKind k | isLiftedTypeKind k = TH.StarK reifyNonArrowKind k | isLiftedTypeKind k = TH.StarK
| otherwise = pprPanic "Exotic form of kind" | 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