title: When are module level "constant" arrays being initialized in F#
body: <p>The question came up while I was trying to write a lookup table and during debugging I had the impression, that the array might not be initialized at compile or load time, but rather in a lazy way... Unfortunately I could not find the answer in the MSDN chapter about arrays. </p>
  
  <p>Lets look at some sample code first. The code is in a compiled application, not a script, btw.</p>
  
  <pre><code>module Foo = 
      let bar = [| for i in 0..9 -&gt; yield (i*i) |] 
  </code></pre>
  
  <p>When does <code>Foo.bar</code> get initialized?</p>
  
  <ol>
  <li>At compile time?</li>
  <li>At load time?</li>
  <li>Lazy, when first accessed?</li>
  <li>Never? (Stays an IEnumerator based sequence despite its array type?)</li>
  </ol>
  
  <p>On a side note, my sequence expression is more complicated than the example above and also uses other functions within scope.</p>
  
  <p>Are there cases which are handled in different ways, such as trivial vs complex eypression or long vs short array etc?</p>