What is the use case for multi-type-parameter generics? In C#, one can define a class/method/function with multiple type parameters. For example, 

// function
void foo&lt;T1, T2&gt;(T1 x, T2 y) { /*body*/}

// class
class Bar&lt;T1, T2&gt; { /*body*/ }


I understand how to use it, but I don't understand why I need it. So I'm hoping someone can answer the following questions:

1) What is the use case for multiple type parameters?

2) Based on the use case given in Question 1, what are the alternative solutions for that use case if multiple type parameters is not a feature of the language in use?
Some use cases for multiple type arguments include


maps/dictionaries Map&lt;K,V&gt;, where you have one key parameter and one value parameter
product types Pair&lt;A,B&gt;
sum types, AKA variants Variant&lt;A,B&gt;, which represent a value which might be either of type A or of type B
Function-like types Func&lt;A,B&gt; representing a function from A to B
"Visitor" objects for parametric types. I.e. a visitor for List&lt;A&gt; is ListVisitor&lt;A,R&gt; where R is the return type of the visitor.


If we did not have multiple type arguments, or any other way to emulate multiple argument types (e.g. nested parametric classes class T&lt;A&gt; { class U&lt;B&gt; { ... which are a sort-of curried version of the two-arguments class), we could not express the examples above in a generic way.

Of course, a programming language could disallow generic classes and still have a specific primitive type for some of the examples above. For instance, Func&lt;A,B&gt; could be a primitive type, instead of a user/library-defined class type.