Hmmm. So you think maybe it's doing something like (roughly; I don't have the 
exact case in front of me)
(\p q -> f p (g p q)) this that
==> beta reduce
let  p = this  q = thatin f p (g p q)
==> inline q
let  p = thisin f p (g p that)?
I tried marking the "this" in question INLINE CONLIKE [0]. Shouldn't that tell 
GHC that duplicating it is fine? I really want to see it for RULES.

David FeuerWell-Typed, LLP
-------- Original message --------From: Simon Peyton Jones 
<[email protected]> Date: 3/26/18  7:14 PM  (GMT-05:00) To: David Feuer 
<[email protected]>, [email protected] Subject: RE: Missed beta 
reductions 
GHC always beta-reduces.

It does not always inline.   For that: -ddump-inlinings

Simon

From: ghc-devs <[email protected]> On Behalf Of David Feuer
Sent: 26 March 2018 23:59
To: [email protected]
Subject: Missed beta reductions

What's the best way to find spots where GHC saw a redex and choose not to beta 
reduce? Is there a flag for that? It could be useful when trying to figure out 
why rules aren't firing.


David Feuer
Well-Typed, LLP
_______________________________________________
ghc-devs mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to