title: Why are there Uppercase Named Patterns in F#?
body: <p>In <a href="http://fsharp.org/specs/language-spec/4.0/FSharpSpec-4.0-latest.pdf" rel="nofollow noreferrer">The F# 4.0 Language Specification</a>, it said that:</p>
  
  <blockquote>
    <p><strong>7.2 Named Patterns</strong></p>
    
    <p>If <strong><em>long-ident</em></strong> is more than one-character long or begins with an uppercase character (that is, if <strong>System.Char.IsUpperInvariant</strong> is <strong>true</strong> and <strong>System.Char.IsLowerInvariant</strong> is <strong>false</strong> on the first character), it is resolved by using <em>Name Resolution in Patterns</em> (§14.1.6). This algorithm produces one of the following:</p>
    
    <ul>
    <li>A union case </li>
    <li>An exception label</li>
    <li>An active pattern case name</li>
    <li>A literal value</li>
    </ul>
  </blockquote>
  
  <p>So the following code will not work:</p>
  
  <pre><code>[&lt;Literal&gt;]
  let zero = 0
  
  let matchZero = function
      | zero -&gt; printfn "Is %A" zero
      | _ -&gt; printfn "Not 0"
  </code></pre>
  
  <p>The <code>zero</code> should be used with a module, or has first uppercase letter <code>Z</code>:</p>
  
  <pre><code>module Match =
      [&lt;Literal&gt;]
      let zero = 0
  
  let matchZero = function
      | Match.zero -&gt; printfn "Is %A" Match.zero
      | _ -&gt; printfn "Not 0"
  
  ///////////////////////////////////////
  ///////////////////////////////////////
  
  [&lt;Literal&gt;]
  let Zero = 0
  
  let matchZero = function
      | Zero -&gt; printfn "%A" Zero
      | _ -&gt; printfn "Not 0"
  </code></pre>
  
  <p>Why must the literal <code>zero</code> have the first uppercase letter to work correctly?</p>