X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreArity.lhs;h=f39b6b92352ebe07a18c5851a536dc73423e9b1b;hb=21eea25f1212ec306aac806233a2ec048212d529;hp=0d1b394db212c613b62c050d197f78e5fca9f465;hpb=62eeda5aed31173b234b2965ccf4bd6979ffd9a4;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CoreArity.lhs b/compiler/coreSyn/CoreArity.lhs index 0d1b394..f39b6b9 100644 --- a/compiler/coreSyn/CoreArity.lhs +++ b/compiler/coreSyn/CoreArity.lhs @@ -22,11 +22,9 @@ import CoreSubst ( Subst, substBndr, substBndrs, substExpr , mkEmptySubst, isEmptySubst ) import Var import VarEnv -#if mingw32_TARGET_OS -import Packages -#endif import Id import Type +import TcType ( isDictLikeTy ) import Coercion import BasicTypes import Unique @@ -296,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 @@ -314,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}