Max Bolingbroke wrote:
> On 15 February 2011 15:12, Roman Leshchinskiy <r...@cse.unsw.edu.au> wrote:
>
>> Ah, but you assume that bar won't be inlined into foo first. Consider
>> that it is perfectly acceptable for GHC to generate this:
>>
>> foo = <big> {-# INLINE bar #-}
>> bar = <big>
>>
>> We did ask to inline bar, after all.
>>
>
> Well, yes, but when considering the use site for foo don't we now
> inline the *original RHS* of foo? This recent change means that it doesn't
> matter whether bar gets inlined into foo first - use sites of foo will
> only get a chance to inline the "bar" RHS.

Only if foo has an INLINE pragma. Otherwise, GHC uses whatever RHS is
available when it wants to inline.

Roman




_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to