title: Visual C# Collection "map" function?
body: <p>In Haskell we have the function </p>
  
  <pre><code>map (a -&gt; b) -&gt; [a] -&gt; [b]
  </code></pre>
  
  <p>to change the type of a Collection using a function.</p>
  
  <p>Is there something similar in C#?</p>
  
  <p>Or what else is the fastest way to put a complete collection of KeyValuePairs into a debug message, for example?</p>
  
  <p>I thought of sth like</p>
  
  <pre><code>debugmsg("http response is " + service.HttpResponseHeaders
                                        .Map&lt;string&gt;((k, v) =&gt; k + "-&gt;" + v)
                                        .Aggregate((s, sx) =&gt; s + "," + sx)
                               + ". ");
  </code></pre>