Commit 82efad78 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Comments and trivial refactoring

parent 45bfd1a6
......@@ -987,7 +987,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
......
......@@ -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
......
......@@ -239,22 +239,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.
************************************************************************
* *
......
......@@ -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
......
......@@ -1323,15 +1323,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment