diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-09-19 10:08:29 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-09-20 21:47:59 +0100 |
commit | c30773ce53714980594a5fa2b8a0e6f5547b3c4d (patch) | |
tree | 8454267e400c37cc1cc042026ea4665e9e25ca21 | |
parent | 831882f23f5df3415f6c719479a3541d51d03d77 (diff) | |
download | haskell-c30773ce53714980594a5fa2b8a0e6f5547b3c4d.tar.gz |
Comments and trivial refactoring
-rw-r--r-- | compiler/basicTypes/BasicTypes.hs | 2 | ||||
-rw-r--r-- | compiler/hsSyn/HsBinds.hs | 4 | ||||
-rw-r--r-- | compiler/simplCore/CoreMonad.hs | 16 | ||||
-rw-r--r-- | compiler/simplCore/SimplCore.hs | 16 | ||||
-rw-r--r-- | compiler/typecheck/TcInstDcls.hs | 6 | ||||
-rw-r--r-- | compiler/types/TyCoRep.hs | 2 |
6 files changed, 24 insertions, 22 deletions
diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index aab0528d1c..d911a546b6 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -961,7 +961,7 @@ data InlinePragma -- Note [InlinePragma] -- That is, inl_sat describes the number of *source-code* -- arguments the thing must be applied to. We add on the -- number of implicit, dictionary arguments when making - -- the InlineRule, and don't look at inl_sat further + -- the Unfolding, and don't look at inl_sat further , inl_act :: Activation -- Says during which phases inlining is allowed diff --git a/compiler/hsSyn/HsBinds.hs b/compiler/hsSyn/HsBinds.hs index 236892e70d..487859249f 100644 --- a/compiler/hsSyn/HsBinds.hs +++ b/compiler/hsSyn/HsBinds.hs @@ -593,6 +593,7 @@ ppr_monobind (AbsBinds { abs_tvs = tyvars, abs_ev_vars = dictvars pprLHsBinds val_binds ppr_monobind (AbsBindsSig { abs_tvs = tyvars , abs_ev_vars = dictvars + , abs_sig_export = poly_id , abs_sig_ev_bind = ev_bind , abs_sig_bind = bind }) = sdocWithDynFlags $ \ dflags -> @@ -600,7 +601,8 @@ ppr_monobind (AbsBindsSig { abs_tvs = tyvars hang (text "AbsBindsSig" <+> brackets (interpp'SP tyvars) <+> brackets (interpp'SP dictvars)) 2 $ braces $ vcat - [ text "Bind:" <+> ppr bind + [ text "Exported type:" <+> pprBndr LetBind poly_id + , text "Bind:" <+> ppr bind , text "Evidence:" <+> ppr ev_bind ] else ppr bind diff --git a/compiler/simplCore/CoreMonad.hs b/compiler/simplCore/CoreMonad.hs index 853f5be149..a386a28954 100644 --- a/compiler/simplCore/CoreMonad.hs +++ b/compiler/simplCore/CoreMonad.hs @@ -238,22 +238,6 @@ runMaybe (Just x) f = f x runMaybe Nothing _ = CoreDoNothing {- -Note [RULEs enabled in SimplGently] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -RULES are enabled when doing "gentle" simplification. Two reasons: - - * We really want the class-op cancellation to happen: - op (df d1 d2) --> $cop3 d1 d2 - because this breaks the mutual recursion between 'op' and 'df' - - * I wanted the RULE - lift String ===> ... - to work in Template Haskell when simplifying - splices, so we get simpler code for literal strings - -But watch out: list fusion can prevent floating. So use phase control -to switch off those rules until after floating. - ************************************************************************ * * diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index 8bc03929f0..0af167ef3e 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -367,6 +367,22 @@ addPluginPasses builtin_passes #endif {- +Note [RULEs enabled in SimplGently] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +RULES are enabled when doing "gentle" simplification. Two reasons: + + * We really want the class-op cancellation to happen: + op (df d1 d2) --> $cop3 d1 d2 + because this breaks the mutual recursion between 'op' and 'df' + + * I wanted the RULE + lift String ===> ... + to work in Template Haskell when simplifying + splices, so we get simpler code for literal strings + +But watch out: list fusion can prevent floating. So use phase control +to switch off those rules until after floating. + ************************************************************************ * * The CoreToDo interpreter diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs index 572b3f1268..ab91c84587 100644 --- a/compiler/typecheck/TcInstDcls.hs +++ b/compiler/typecheck/TcInstDcls.hs @@ -1316,15 +1316,15 @@ tcMethodBody clas tyvars dfun_ev_vars inst_tys -- Substitute the local_meth_name for the binder -- NB: the binding is always a FunBind - ; global_meth_id <- addInlinePrags global_meth_id prags - ; spec_prags <- tcSpecPrags global_meth_id prags - -- taking instance signature into account might change the type of -- the local_meth_id ; (meth_implic, ev_binds_var, tc_bind) <- checkInstConstraints $ tcMethodBodyHelp sig_fn sel_id local_meth_id (L bind_loc lm_bind) + ; global_meth_id <- addInlinePrags global_meth_id prags + ; spec_prags <- tcSpecPrags global_meth_id prags + ; let specs = mk_meth_spec_prags global_meth_id spec_inst_prags spec_prags export = ABE { abe_poly = global_meth_id , abe_mono = local_meth_id diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index cd221a2ebf..88352e93f8 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1686,7 +1686,7 @@ the range of the TvSubstEnv should *never* include a type headed with CoercionTy. Note [The substitution invariant] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When calling (substTy subst ty) it should be the case that the in-scope set in the substitution is a superset of both: |