Implement -fexpose-all-unfoldings, and fix a non-termination bug
[ghc-hetmet.git] / compiler / deSugar / DsBinds.lhs
index 85487e6..0bb7045 100644 (file)
@@ -376,9 +376,9 @@ get to do the inlining, which is a Terribly Bad thing given that the
 user said "inline"!
 
 To avoid this we pre-emptively eta-expand the definition, so that foo
-has arity 2 (one for the Eq and one for x); and that in turn should
-mean that (foo d) is a PAP and we don't share it.
-
+has the arity with which it is declared in the source code.  In this
+example it has arity 2 (one for the Eq and one for x). Doing this 
+should mean that (foo d) is a PAP and we don't share it.
 
 Note [Nested arities]
 ~~~~~~~~~~~~~~~~~~~~~
@@ -452,7 +452,7 @@ dsSpecs all_tvs dicts tvs poly_id mono_id inl_arity mono_bind prags
                bs | not (null bs) -> do { warnDs (dead_msg bs); return Nothing } 
                   | otherwise -> do
 
-          { (spec_unf, unf_pairs) <- specUnfolding wrap_fn (idUnfolding poly_id)
+          { (spec_unf, unf_pairs) <- specUnfolding wrap_fn (realIdUnfolding poly_id)
 
           ; let f_body = fix_up (Let mono_bind (Var mono_id))
                  spec_ty = exprType ds_spec_expr