X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreArity.lhs;h=f39b6b92352ebe07a18c5851a536dc73423e9b1b;hb=ac38ece1e717cb412e89354aa95fd11d44c1cefb;hp=2dfed4916de299924e9c77416e2e55d46c510311;hpb=a602a61e9b361eea186d6979f1b4520ea67726e1;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CoreArity.lhs b/compiler/coreSyn/CoreArity.lhs index 2dfed49..f39b6b9 100644 --- a/compiler/coreSyn/CoreArity.lhs +++ b/compiler/coreSyn/CoreArity.lhs @@ -24,6 +24,7 @@ import Var import VarEnv import Id import Type +import TcType ( isDictLikeTy ) import Coercion import BasicTypes import Unique @@ -293,7 +294,7 @@ arityType dflags (Let b e) where cheap_bind (NonRec b e) = is_cheap (b,e) cheap_bind (Rec prs) = all is_cheap prs - is_cheap (b,e) = (dopt Opt_DictsCheap dflags && isDictId b) + is_cheap (b,e) = (dopt Opt_DictsCheap dflags && isDictLikeTy (idType b)) || exprIsCheap e -- If the experimental -fdicts-cheap flag is on, we eta-expand through -- dictionary bindings. This improves arities. Thereby, it also @@ -311,6 +312,9 @@ arityType dflags (Let b e) -- -- One could go further and make exprIsCheap reply True to any -- dictionary-typed expression, but that's more work. + -- + -- See Note [Dictionary-like types] in TcType.lhs for why we use + -- isDictLikeTy here rather than isDictTy arityType _ _ = ATop \end{code}