摘要:
result: 阅读全文
摘要:
隐式类可以用来扩展对象的功能非常方便 example: 阅读全文
摘要:
How to use type alias to name a Tuple2 pair into a domain type called CartItem type CartItem[Donut, Int] = Tuple2[Donut, Int] 阅读全文
摘要:
Partial函数的定义 scala> val isVeryTasty: PartialFunction[String, String] = { case "Glazed Donut" | "Strawberry Donut" => "Very Tasty"}isVeryTasty: Partial 阅读全文
摘要:
可以使用scala库,可以从字面上看出是在调用 递归函数: code resule: 阅读全文
摘要:
Ordering using andThen: f(x) andThen g(x) = g(f(x)) Ordering using compose: f(x) compose g(x) = f(g(x)) result: 阅读全文