title: Declare type list argument in F#
body: <p>I am building a simple function that compares two lists and returns <code>true</code> if the first list is a prefix of the second one.
  Expected signature:</p>
  
  <pre><code>prefix: int list -&gt; int list -&gt; bool
  </code></pre>
  
  <p>For example: </p>
  
  <pre><code>prefix [1; 2] [1; 2; 3; 4] --&gt; true
  prefix [ ] [1;2] --&gt; true
  prefix [2] [1;2;3] --&gt; false
  </code></pre>
  
  <p>Right now, I am at this step:</p>
  
  <pre><code>let prefix l1 l2 =
          match l1 with
          | (l1, l2) when (l1.[0] = l2.[0]) -&gt; true
          | _ -&gt; false 
  </code></pre>
  
  <p>I think I could be on the right way, but I got this error:</p>
  
  <pre><code> The operator 'expr.[idx]' has been used on an object of
      indeterminate type based on information prior to this program point. Consider adding 
      further type constraints
  </code></pre>
  
  <p>How can I declare in <code>prefix</code> that <code>l1</code> and <code>l2</code> are lists? I looked for a solution <a href="https://en.wikibooks.org/wiki/F_Sharp_Programming/Lists" rel="nofollow noreferrer">here</a> but the problem is probably so trivial that I there is not an answer.</p>