title: Combining type bounds in Scala
body: <p>Let's say I have a function such as:</p>
  
  <pre><code>def foo[T&lt;:U &lt;:V](t:T): Unit
  </code></pre>
  
  <p>I want to know if there is a way of combining these two in a type <code>W</code> so that I can have:</p>
  
  <pre><code>def foo[T&lt;: W](t: T): Unit
  </code></pre>
  
  <p>The use case for this is:</p>
  
  <pre><code>trait FooTrait{
     type W
     def foo[T&lt;: W](t: T): Unit
  }
  </code></pre>
  
  <p>I might have two different implementations of foo, one of them with a simple <code>W1</code> type bound whereas the other one is <code>T&lt;:W1 &lt;:W2</code> I want the more complex one to define a <code>W3</code> so that I can have:</p>
  
  <pre><code>def foo[T&lt;: W3](t: T): Unit
  </code></pre>
  
  <p>Similiarly, I want to be able to do these with type classes. So if I have:</p>
  
  <pre><code>def bar[T&lt;:U :V](t:T): Unit
  </code></pre>
  
  <p>I want to have </p>
  
  <pre><code>def bar[T:X](t:T): Unit
  </code></pre>
  
  <p>The use case for this is essentially the same as the earlier case.</p>
  
  <p>is this possible?</p>