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!
= 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
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"