title: Interacting with generic types and boxing/unboxing
body: <p>I'm interested in understanding more about how the following is possible. Given a collection constrained to type obj and the following function:</p>
  
  <pre><code>let myList = new ResizeArray&lt;obj&gt;()
  
  let addToMyListTuple&lt;'a&gt; (item : string * 'a) =
      let boxed = box item
      let unboxed = unbox&lt;string * 'a&gt; boxed
      let item1 = match unboxed with first, _ -&gt; first
      Console.WriteLine(sprintf "%A" item1)
      myList.Add(boxed)
  </code></pre>
  
  <p>Interacting with these 2 gives the expected results and the string part of the tuple can be consumed regardless of the associated type in the second part.</p>
  
  <pre><code>addToMyListTuple("integer", 3)
  addToMyListTuple("float", 3.0)
  addToMyListTuple("string", "string")
  addToMyListTuple("tuple", (3, "integer"))
  </code></pre>
  
  <p>However, what I was hoping would be possible was this where I would be able to interact with items in the list at a later time and unbox the obj in such a way that accessing the string part of the tuple would be possible. </p>
  
  <pre><code>myList
  |&gt; Seq.iter(fun x -&gt;
      let unboxed = unbox&lt;string * 'a&gt; x
      let item1 = match unboxed with first, _ -&gt; first
      Console.WriteLine(sprintf "%A" item1)
  )
  </code></pre>
  
  <p>Running this gives me the compile time warning</p>
  
  <pre><code>This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'obj'.
  </code></pre>
  
  <p>and the runtime exception</p>
  
  <pre><code>System.InvalidCastException: Unable to cast object of type 'System.Tuple`2[System.String,System.Int32]' to type 'System.Tuple`2[System.String,System.Object]'.
  </code></pre>
  
  <p>Is there any other way to accomplish this behavior?</p>