X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcBinds.lhs;h=5d966f92633b4bd06b83a53171447532b0cac38c;hp=368ede48694003858982a0a45c2dbb018d9689f8;hb=a6f2d598e1e7760d334d1b5ea0b7745e66835e11;hpb=896135d0231f798f264548f5935223d142e718a7 diff --git a/compiler/typecheck/TcBinds.lhs b/compiler/typecheck/TcBinds.lhs index 368ede4..5d966f9 100644 --- a/compiler/typecheck/TcBinds.lhs +++ b/compiler/typecheck/TcBinds.lhs @@ -1082,7 +1082,7 @@ decideGeneralisationPlan dflags top_lvl _bndrs binds sig_fn | Just sig <- one_funbind_with_sig binds = if null (sig_tvs sig) && null (sig_theta sig) then NoGen -- Optimise common case else CheckGen sig - | (dopt Opt_MonoLocalBinds dflags + | (xopt Opt_MonoLocalBinds dflags && isNotTopLevel top_lvl) = NoGen | otherwise = InferGen mono_restriction @@ -1090,10 +1090,10 @@ decideGeneralisationPlan dflags top_lvl _bndrs binds sig_fn -- | otherwise = NoGen -- A mixture of function -- -- and pattern bindings where - mono_pat_binds = dopt Opt_MonoPatBinds dflags + mono_pat_binds = xopt Opt_MonoPatBinds dflags && any (is_pat_bind . unLoc) binds - mono_restriction = dopt Opt_MonomorphismRestriction dflags + mono_restriction = xopt Opt_MonomorphismRestriction dflags && any (restricted . unLoc) binds no_sig n = isNothing (sig_fn n)