AS
s.sorted((a:String, b:String) => a.charAt(a.length - 1) - b.charAt(b.length - 1))
Size: a a a
AS
OO
В
AS
/** Returns an integer whose sign communicates how x compares to y.
*
* The result sign has the following meaning:
*
* - negative if x < y
* - positive if x > y
* - zero otherwise (if x == y)
*/
def compare(x: T, y: T): Int
λ
DS
λ
λ
M
resources.foldLeft(Client(..)) {
case (client, MyResType(v)) => ...
case (client, resource) => ...
}
ΛВ
resources.foldLeft(Client(..)) {
case (client, MyResType(v)) => ...
case (client, resource) => ...
}
ΛВ
val f: (Int, String) => Boolean = {
case (3, "a") => true
case (2, "b") => false
case (a, b) => b.length == a
}
ΛВ
M
GP
ΛВ
ΛВ
ΛВ
ΛВ
val
pf:
PartialFunction[(Int, String
), Boolean
] = {
case (3, "a") => true
case (2, "b") => false
}
NV
AS
PartialFunction[A, B]
extends A => B
.