here is the output of<p><pre><code>    main = print $ product [1..100]

    ghc-core-html --ghc-option=-ddump-simpl --ghc-option=-dsuppress-all fact.hs
</code></pre>
<a href="https:&#x2F;&#x2F;rawgit.com&#x2F;jonschoning&#x2F;c4ad2129aa7d258e65f9&#x2F;raw&#x2F;f8edf61aaba6a7a28dc60bb935738d648e53335c&#x2F;fact.html" rel="nofollow">https:&#x2F;&#x2F;rawgit.com&#x2F;jonschoning&#x2F;c4ad2129aa7d258e65f9&#x2F;raw&#x2F;f8ed...</a><p>you can see<p><pre><code>    main_go (plusInteger x_a3Sq main4) (timesInteger eta_B1 x_a3Sq);
</code></pre>
where it compiles to a recursive loop with an accumulator<p>typicall the [1..100] gets compiled to (enumFromTo 1 100) and it can be desugared further..<p>so, yeah, foldmap compiles to foldr which may compile down further