[Haskell-cafe] Monad transformer performance - Request to review benchmarking code + results

Saurabh Nanda saurabhnanda at gmail.com
Tue Feb 7 02:49:25 UTC 2017


Inlining can only happen if the code to be inlined is available. This
means explicitly marking things with {-# INLINE #-} or {-# INLINEABLE
#-} (or GHC seeing something as "small" and deciding it's worth putting
in the .hi file). If I give you "foo True" and tell you nothing more
about "foo" - how are you going to optimise that? That's essentially
what is happening - GHC has no more information so all it can do is just
call the function and hope for the best.


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?

-- Saurabh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170207/e7796e98/attachment.html>


More information about the Haskell-Cafe mailing list