title: Anonymous types in Scala
body: <p>Trying to convert few of my C# project into Scala, and still trying to figure out how do to some of the conversion. I came across this code and would appreciate if someone can help me to write below code in Scala, i m particularly interested in anonymous code block in Select statement.</p>
  
  <pre><code>static void Main(string[] args)
  {
    Stock stk = new Stock();
    Select(stk, a =&gt; new { a.Prices, a.Symbol });
  }
  public static U Select&lt;T, U&gt;(T data,Func&lt;T,U&gt; item)
  {
    return item(data);
  }
  </code></pre>