title: F# - How do I extend a type with get_Zero so I can use an existing type generically?
body: <p>I attempt the following:</p>
  
  <pre><code>let c x = System.Numerics.Complex(x, 0.0)
  let sum = [c 1.0; c 2.0] |&gt; List.sum
  </code></pre>
  
  <p>But I get this error:</p>
  
  <p><code>The type 'System.Numerics.Complex' does not support the operator 'get_Zero'</code></p>
  
  <p>I read the rules on type extensions, from <a href="https://msdn.microsoft.com/en-us/library/dd233211.aspx" rel="noreferrer">https://msdn.microsoft.com/en-us/library/dd233211.aspx</a>, and try to do the following:</p>
  
  <pre><code>module ComplexExtension =
      let c x = System.Numerics.Complex(x, 0.0)
  
      type System.Numerics.Complex with
          // I also tried a bunch of other ways of writing these
          // as static or instance members, but nothing worked
          static member Zero = c 0.0
          static member One = c 1.0
  
  open ComplexExtension
  
  let sum = [c 1.0; c 2.0] |&gt; List.sum
  </code></pre>
  
  <p>I still get that error.</p>
  
  <p>Is it possible to extend a type with the get_Zero operator? Or do I have to create my own wrapper type around <code>System.Numerics.Complex</code> and override all the operators if I want it to do the other things that complex numbers do?</p>