Are 'length' calls rewritten as constant ints by GHC?
<p>Just a random pondering looking at my numerous <code>length</code> calls, it occurs to me that surely the compiler can tell the length of <em>any</em> list thanks to immutability and referential transparency (even when new lists are <code>concat</code>-ed from existing known lists / code paths). Then it will likely replace all <code>length l</code> "calls" with the <em>actual</em> int constant at some stage during low-level code generation, right?</p>

<p>Wondering if it indeed does, or whether I'm missing something in my beginner intuition about pure functional languages/compiler.</p>