From: simonpj@microsoft.com Date: Wed, 17 Mar 2010 12:35:19 +0000 (+0000) Subject: Fix Trac #3920: Template Haskell kinds X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=f69bf6be6101d6b5d7952c384dd5eeb1917b4cdb;hp=1a050f3cff3a93f634d2d929aba779585f39609c 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! --- diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index f071a17..3f7f4d0 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -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 diff --git a/compiler/typecheck/TcSplice.lhs b/compiler/typecheck/TcSplice.lhs index d67a57b..61ed8c7 100644 --- a/compiler/typecheck/TcSplice.lhs +++ b/compiler/typecheck/TcSplice.lhs @@ -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"