X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcoreSyn%2FMkExternalCore.lhs;h=5ca43452f7d030e1aaf858e685a0d50e47108496;hp=337b21a8f0ff09c5fad947879e40c32ca37c723b;hb=d89d0f0a7d39a4390894b7b36c2b0ce24b1b300e;hpb=0cef3aef2b443ae02742d5543a403df66037c30f diff --git a/compiler/coreSyn/MkExternalCore.lhs b/compiler/coreSyn/MkExternalCore.lhs index 337b21a..5ca4345 100644 --- a/compiler/coreSyn/MkExternalCore.lhs +++ b/compiler/coreSyn/MkExternalCore.lhs @@ -95,7 +95,11 @@ collect_tdefs tcon tdefs -- See Note [Newtype coercions] in -- types/TyCon Just (arity,coKindFun) | (l,r) <- (coKindFun $ map mkTyVarTy vs) -> - (vs,l,r) where vs = take arity tyvars + -- Here we eta-expand the newtype coercion, + -- which makes the ext-core typechecker somewhat simpler. + (tyvars,mkAppTys l extraVs,mkAppTys r extraVs) + where (vs, extraVs) = (take arity tyvars, + map mkTyVarTy $ drop arity tyvars) Nothing -> pprPanic "MkExternalCore: coercion tcon lacks a kind fun" (ppr tcon)