title: How can I define an anonymous generic Scala function?
body: <p>Let's say I have this:</p>
  
  <pre><code>val myAnon:(Option[String],String)=&gt;String = (a:Option[String],defVal:String) =&gt; {
    a.getOrElse(defVal)
  }
  </code></pre>
  
  <p>Don't mind what the function does. Is there anyway of making it generic, so I can have an Option[T]?</p>