&gt; For a human it is much easier to structure such a rewrite as a sequence of very trivial changes. And a &quot;sufficiently smart&quot; compiler must realise that it can be done in less steps.<p>See, the problem is, for the &quot;sufficiently smart&quot; compiler to easily realize this is possible, the passes need to be purely functional. It turns out, most programmers struggle with understanding functional programming...