foldr usually gets deforested in GHC<i>, so the intermediate list probably doesn&#x27;t exist.<p></i>GHC rewrites most of the common built-in functions to eliminate intermediate trees and lists. You can see a list <a href="https:&#x2F;&#x2F;downloads.haskell.org&#x2F;~ghc&#x2F;7.0.1&#x2F;docs&#x2F;html&#x2F;users_guide&#x2F;rewrite-rules.html" rel="nofollow">https:&#x2F;&#x2F;downloads.haskell.org&#x2F;~ghc&#x2F;7.0.1&#x2F;docs&#x2F;html&#x2F;users_gui...</a> (section 7.14.4; ctrl-f &quot;good producer&quot;).