摘要: result: 阅读全文
posted @ 2019-07-12 14:03 嵌入式实操 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 隐式类可以用来扩展对象的功能非常方便 example: 阅读全文
posted @ 2019-07-12 11:22 嵌入式实操 阅读(158) 评论(0) 推荐(0) 编辑
摘要: How to use type alias to name a Tuple2 pair into a domain type called CartItem type CartItem[Donut, Int] = Tuple2[Donut, Int] 阅读全文
posted @ 2019-07-12 11:13 嵌入式实操 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Partial函数的定义 scala> val isVeryTasty: PartialFunction[String, String] = { case "Glazed Donut" | "Strawberry Donut" => "Very Tasty"}isVeryTasty: Partial 阅读全文
posted @ 2019-07-12 10:59 嵌入式实操 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 可以使用scala库,可以从字面上看出是在调用 递归函数: code resule: 阅读全文
posted @ 2019-07-12 10:02 嵌入式实操 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Ordering using andThen: f(x) andThen g(x) = g(f(x)) Ordering using compose: f(x) compose g(x) = f(g(x)) result: 阅读全文
posted @ 2019-07-12 09:50 嵌入式实操 阅读(81) 评论(0) 推荐(0) 编辑