title: F# pattern matching on types of tuples
body: <p>I have a curried function that I'd like it to support different types of parameters, that are not on a inheritance relationship:</p>
  
  <pre><code>type MyType1 = A | B of float
  type MyType2 = C | D of int
  </code></pre>
  
  <p>What I tried to do is:</p>
  
  <pre><code>let func x y =
      match (x, y) with
      | :? Tuple&lt;MyType1, MyType1&gt; -&gt; "1, 1"
      | _ -&gt; "..."
  </code></pre>
  
  <p>However this is not possible. F# complains:</p>
  
  <blockquote>
    <p>The type ''a * 'b' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion.</p>
  </blockquote>
  
  <p>What is an elegant way to do this?</p>
  
  <p><strong>EDIT</strong>: Let me try to clarify this.</p>
  
  <p>I have two similar, but distinct, types. I can <em>very</em> easily convert one type to another. I want to define a binary operation that will act on entities of those types, but I'd like to expose a single operation to the client.</p>
  
  <p>That is, instead of providing:</p>
  
  <pre><code>let op11 (x : MyType1) (y : MyType1) = // do something useful
  let op12 (x : MyType1) (y : MyType2) =
      // convert y to MyType1
      let y' = // ...
      // dispatch to op11
      op11 x y'
  let op21 (x : MyType2) (y : MyType1) = // similar
  let op22 (x : MyType2) (y : MyType2) = // similar
  </code></pre>
  
  <p>what I would like is to expose a single function to client code:</p>
  
  <pre><code>let op (x : obj) (y : obj) = // ...
  </code></pre>
  
  <p>This is like simulating the behavior of method overloading, but with curried functions.</p>