<div dir="auto"><div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"><br>
</div>Inlining can only happen if the code to be inlined is available. This<br>
means explicitly marking things with {-# INLINE #-} or {-# INLINEABLE<br>
#-} (or GHC seeing something as "small" and deciding it's worth putting<br>
in the .hi file). If I give you "foo True" and tell you nothing more<br>
about "foo" - how are you going to optimise that? That's essentially<br>
what is happening - GHC has no more information so all it can do is just<br>
call the function and hope for the best.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text"></div></blockquote></div></div></div><div dir="auto">I don't understand. If the compiler can figure out how to inline certain functions automatically (without the use of the INLINE pragma), what's causing Monad binds and lifts to be out of the consideration set? Why do you say GHC has "no more information"? How does it have "more information" about functions that it does decide to inline automatically?</div><div dir="auto"><br></div><div dir="auto">-- Saurabh. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text"><br></div></blockquote></div></div></div></div>