Scala: 偏函數(PartialFunction) && 偏應用函數(Partial Applied Function)

偏函數( 偏函數是隻對函數定義域的一個子集進行定義的函數。 scala中用scala.PartialFunction[-T, +S]類來表示 ) Scala提供了定義偏函數(PartialFunction)的語法快捷:html val pf: PartialFunction[Int, String] = { case i if i%2 == 0 => "even" } 它們也可能由 orE
相關文章
相關標籤/搜索