Scala學習——資源整理

模式匹配

話說模式匹配(1) 什麼是模式?http://hongjiang.info/scala-pattern-matching-1/
話說模式匹配(2) scala裏是怎麼實現的? http://hongjiang.info/scala-pattern-matching-2/
話說模式匹配(3) 模式匹配的核心功能是解構!http://hongjiang.info/scala-pattern-matching-3/
話說模式匹配(4) 賦值語句與模式匹配 http://hongjiang.info/scala-pattern-matching-4/
話說模式匹配(5) for表達式中的模式匹配 http://hongjiang.info/scala-pattern-matching-5/
話說模式匹配(6) case類的細節 http://hongjiang.info/scala-pattern-matching-6/
話說模式匹配(7) 一個構造器模式的例子(by case class) http://hongjiang.info/scala-pattern-matching-7/
話說模式匹配(8) 一個抽取器的例子 http://hongjiang.info/scala-pattern-matching-8/

類型相關
scala類型系統:1) 類型與類 http://hongjiang.info/scala-type-and-class/
scala類型系統:2) classOf與getClass方法的差異 http://hongjiang.info/scala-type-system-classof-and-getclass/
scala類型系統:3) 單例類型 http://hongjiang.info/scala-type-system-singleton-type/
scala類型系統:4) 內部類,路徑依賴類型&類型投影 http://hongjiang.info/scala-type-system-inner-type-and-type-projection/
scala類型系統:5) 結構類型 http://hongjiang.info/scala-type-system-structural-type/
scala類型系統:6) 複合類型與with關鍵字 http://hongjiang.info/scala-type-system-compund-type/
scala類型系統:7) 中綴類型 http://hongjiang.info/scala-type-system-infix-type/
scala類型系統:8) type關鍵字 http://hongjiang.info/scala-type-system-type-keyword/
scala類型系統:9) this別名&自身類型 http://hongjiang.info/scala-type-system-self-type/
scala類型系統:10) 交集類型與聯合類型 http://hongjiang.info/scala-intersection-type-and-union-type/
scala類型系統:11) upper bounds & lower bounds http://hongjiang.info/scala-upper-bounds-and-lower-bounds/
scala類型系統:12) view bounds http://hongjiang.info/scala-type-system-view-bounds/
scala類型系統:13) context bounds http://hongjiang.info/scala-type-system-context-bounds/
scala類型系統:14) multiple bounds http://hongjiang.info/scala-type-system-multiple-bounds/
scala類型系統:15) 協變與逆變 http://hongjiang.info/scala-covariance-and-contravariance/
scala類型系統:16) 函數類型 http://hongjiang.info/scala-function-type/
scala類型系統:17) 結構類型的細節問題 http://hongjiang.info/scala-structural-type-detail/
scala類型系統:18) 不穩定(volatile)類型 http://hongjiang.info/scala-type-system-volatile-type/
scala類型系統:19) Manifest與TypeTag http://hongjiang.info/scala-type-system-manifest-vs-typetag/
scala類型系統:20) 數組類型 http://hongjiang.info/scala-type-system-array-type/
scala類型系統:21) type specialization與類爆炸 http://hongjiang.info/scala-type-specialization/
scala類型系統:22) 類型約束與特定方法 http://hongjiang.info/scala-type-contraints-and-specialized-methods/
scala類型系統:23) 用類型證明實現聯合類型 http://hongjiang.info/scala-type-evidence-and-union-type/
scala類型系統:24) 理解 higher-kinded-type http://hongjiang.info/scala-higher-kinded-type/
scala類型系統:25) type lambda http://hongjiang.info/scala-type-lambda/
scala類型系統:26) type classes模式 http://hongjiang.info/scala-type-classes-pattern/
scala類型系統:27) 回顧常見的type classes http://hongjiang.info/scala-type-classes-review/
scala類型系統:28) 依賴類型 http://hongjiang.info/scala-type-system-dependent-types/
scala類型系統:case class與代數數據類型 http://hongjiang.info/scala-case-class-and-algebraic-data-type/
scala類型系統:類型推導 http://hongjiang.info/scala-type-inference/
scala類型系統:柯里-霍華德同構 http://hongjiang.info/scala-curry-howard-isomorphism/
scala類型系統:值類型與數組 http://hongjiang.info/scala-value-class-in-array/
scala類型系統:Null與Nothing,造型問題 http://hongjiang.info/scala-null-and-nothing/
scala類型系統:值類型的細節 http://hongjiang.info/scala-value-classes-detail/
scala類型系統:通用特質(universal traits) http://hongjiang.info/scala-universal-traits/
scala類型系統:值類型的裝箱問題 http://hongjiang.info/scala-value-class-boxing-question/
scala類型系統:值類型的一些限制 http://hongjiang.info/scala-value-classes/

shapeless
shapeless(1): 從方法與函數的多態談起 http://hongjiang.info/shapeless-1-polymorphic-question/
shapeless(2): 對函數(值)實現參數化多態 http://hongjiang.info/shapeless-2-polymorphic-function-impl/

類型推導相關
泛型方法轉換爲部分應用函數時的類型推導問題 http://hongjiang.info/generic-methods-2-partially-applied-functions/

spray
spray中的Magnet模式: typeclass的一種特定方式 http://hongjiang.info/spray-magnet-pattern/

monads & monoids
我所理解的monad(0) http://hongjiang.info/understand-monad-0/
我所理解的monad(1):半羣(semigroup)與幺半羣(monoid) http://hongjiang.info/semigroup-and-monoid/
我所理解的monad(2):fold與monoid http://hongjiang.info/fold-and-monoid/
我所理解的monad(3):半羣(semigroup)與並行運算 http://hongjiang.info/semigroup-and-parallel/
我所理解的monad(4):函子(functor)是什麼 http://hongjiang.info/understand-monad-4-what-is-functor/
我所理解的monad(5):自函子(Endofunctor)是什麼 http://hongjiang.info/understand-monad-5-what-is-endofunctor/
我所理解的monad(6):從組合子(combinator)說起 http://hongjiang.info/understand-monad-6-combinator/
我所理解的monad(7):把monad看做行爲的組合子 http://hongjiang.info/understand-monad-7-action-combinator/

翻譯&筆記
Programming in Scala的閱讀筆記 http://hongjiang.info/programming-in-scala-notes/
Effective Scala中文版 http://hongjiang.info/effective-scala-chinese/
翻譯 monads-are-elephants 第一部分 http://hongjiang.info/monads-are-elephants-part1-chinese
翻譯 monads-are-elephants 第二部分 http://hongjiang.info/monads-are-elephants-part2-chinese
翻譯 monads-are-elephants 第三部分 http://hongjiang.info/monads-are-elephants-part3-chinese

scala pitfalls
scala霧中風景(0): 序 http://hongjiang.info/scala-pitfalls-0/
scala霧中風景(1): lambda表達式的縮寫 http://hongjiang.info/scala-pitfalls-1/
scala霧中風景(2): 小括號與花括號 http://hongjiang.info/scala-pitfalls-2/
scala霧中風景(3): for表達式的背後 http://hongjiang.info/scala-pitfalls-3/
scala霧中風景(4): Unit類型 http://hongjiang.info/scala-pitfalls-4/
scala霧中風景(5): 中綴表達 http://hongjiang.info/scala-pitfalls-5/
scala霧中風景(6): 內部類與模式匹配 http://hongjiang.info/scala-pitfalls-6/
scala霧中風景(7): val x:Int = x + 1 的問題 http://hongjiang.info/scala-pitfalls-7/
scala霧中風景(8): 高階函數與Unit的謎題 http://hongjiang.info/scala-pitfalls-8/
scala霧中風景(9): List(1,2,3) == Seq(1,2,3) ? http://hongjiang.info/scala-pitfalls-9/
scala霧中風景(10): 逆變點與協變點 http://hongjiang.info/scala-pitfalls-10/
scala霧中風景(11): isInstanceOf與類型擦拭 http://hongjiang.info/scala-pitfalls-11-type-erasure/
scala霧中風景(12): App特質的延遲初始化 http://hongjiang.info/scala-app-trait-delay-init/
scala霧中風景(13): 模式匹配中的邏輯或 http://hongjiang.info/scala-pitfalls-13/
scala霧中風景(14): trait的泛型參數爲何不支持context bounds http://hongjiang.info/scala-pitfalls-14/
scala霧中風景(15): class A { type T }與class A[T] {} http://hongjiang.info/scala-pitfalls-15/
scala霧中風景(16): println(1,2,3)爲什麼work? http://hongjiang.info/scala-pitfalls-16/
scala霧中風景(17): toSet()的謎題 http://hongjiang.info/scala-pitfalls-17/
scala霧中風景(18): postfix operator的問題 http://hongjiang.info/scala-pitfalls-18/
scala霧中風景(19): MutableList與mutable.LinkedList的問題 http://hongjiang.info/scala-pitfalls-19/
scala霧中風景(20): MutableList迭代器的bug http://hongjiang.info/scala-pitfalls-20/
scala霧中風景(21): auto-tupling與auto-detupling http://hongjiang.info/scala-pitfalls-21-auto-tupling-and-auto-detupling/
scala霧中風景(22): var變量與賦值操作符 http://hongjiang.info/scala-pitfalls-22/
scala霧中風景(23): Nothing類型引發的NullPointerException http://hongjiang.info/scala-pitfalls-23-nothing-caused-npe/

診斷
scala的診斷方法(1) 使用-Xprint:typer看語法糖的背後 http://hongjiang.info/scala-diagnose-1/
scala的診斷方法(2) 在repl下用reify查看表達式的翻譯結果 http://hongjiang.info/scala-diagnose-2/
scala的診斷方法(3) 在repl下統計方法的執行時間 http://hongjiang.info/scala-diagnose-3/
scala的診斷方法(4) -Ytyper-debug 編譯項 http://hongjiang.info/scala-diagnose-4/
scala的診斷方法(5) 用scalac-aspects診斷scalac各階段耗時 http://hongjiang.info/scalac-aspects/

函數與函數式風格
無參方法與小括號問題 http://hongjiang.info/scala-parenthesis-and-apply/
scala中的無參方法與統一訪問原則 http://hongjiang.info/scala-uniform-access-principle/
scala中的eta-conversion http://hongjiang.info/scala-eta-conversion/
閉包變量綁定問題 http://hongjiang.info/closure-var-banding/
如何寫一段符合scala語言習慣的快速排序 http://hongjiang.info/scala-quicksort/
Any.##方法與hashCode的區別 http://hongjiang.info/double-pound-sign-and-hashcode/
scala中的有名參數 http://hongjiang.info/scala-named-arguments/
map函數,隱式參數CanBuildFrom的細節 http://hongjiang.info/scala-canbuildfrom-detail/
scala中函數類型的多態 http://hongjiang.info/scala-function-polymorphic/
scala不是函數式語言,與Ocaml的對比 http://hongjiang.info/scala-vs-ocaml/
foldLeft與foldRight http://hongjiang.info/foldleft-and-foldright/
再談eta-conversion與eta-expansion http://hongjiang.info/eta-conversion-and-eta-expansion/

集合相關
對tuple進行迭代 http://hongjiang.info/tuple-iterator/
String當作集合處理時的方法 http://hongjiang.info/string-as-collection/
scala中集合的交集、並集、差集 http://hongjiang.info/scala-union-diff-intersect/
Tuple1的存在意義?http://hongjiang.info/tuple1-purpose/
爲什麼scala中的tuple定義了22個(Tuple22)? http://hongjiang.info/why-tuples-only-to-22/
二元組箭頭表達式背後的語法糖 http://hongjiang.info/scala-any2arrowassoc/
通過List.apply方法構造List的背後邏輯 http://hongjiang.info/scala-list-apply/

API pitfalls
scala類庫中的api陷阱(1): LinkedList.append http://hongjiang.info/scala-api-pitfalls-1/

REPL相關
repl雜記 http://hongjiang.info/repl-misc/
repl下的幾種模式 http://hongjiang.info/scala-repl-modes/
repl下的javap http://hongjiang.info/scala-repl-javap/
scala2.11的repl下增加了kind命令 http://hongjiang.info/scala-repl-kind/

scala 2.10+
scala2.10中eval一段script http://hongjiang.info/scala210-eval-script/
scala2.10.1的repl下:cp命令不能工作 http://hongjiang.info/scala210-repl-cp-do-not-work/
scala2.10中採納了SIP-18:模塊化語言特性 http://hongjiang.info/scala-sip-18/
scala2.10裏的for表達式已經不允許對變量聲明val http://hongjiang.info/for-comprehension-val-definition/
scala2.11編譯環節的一些變動: delambdafy http://hongjiang.info/scala-compiler-delambdafy/
scala2.11編譯器對lint的增強 http://hongjiang.info/scala-211-compiler-lint/

未分類
lazy變量與雙重檢測鎖(DCL) http://hongjiang.info/scala-lazy-and-dcl/
scala裏的靜態代理(static-forwarders) http://hongjiang.info/scala-static-forwarders/
統計詩經中最常使用的疊詞 http://hongjiang.info/scala-counting…ated-character/
scala2.9中@serializable註釋已不鼓勵使用 http://hongjiang.info/serializable-annotation-deprecated/
import _root_.xxx 中的_root_前綴表示xxx包名是絕對路徑 http://hongjiang.info/scala-package-root-prefix/
scala中執行外部命令(scala.sys.process) http://hongjiang.info/scala-process/
classloader問題:import my.package._ 是否會load該包下所有的class? http://hongjiang.info/classloader-question-on-import-classes/
scala中有Unicode的關鍵字 http://hongjiang.info/scala-unicode-reserved-words/
Any類的源碼在哪兒?http://hongjiang.info/cannot-find-soucecode-of-class-any/
scala編譯器的一個bug http://hongjiang.info/scala-compiler-bug/
scala bug系列:2.10編譯器把單例當作類型的bug http://hongjiang.info/scala-bug-210-object-as-type/

分享與交流
分享ppt: scala中的函數與閉包 http://hongjiang.info/scala-function-and-closure/
與19樓的交流 http://hongjiang.info/scala-19lou/
上海scala愛好者聚會(2013) http://hongjiang.info/scala-shanghai-512/
阿里技術嘉年華2013 http://hongjiang.info/adc2013/
2013華東scala愛好者聚會(杭州) http://hongjiang.info/scala-hangzhou-2013-1019/
華東地區scala愛好者聚會(2014上海) http://hongjiang.info/scala-shanghai-2014/
華東地區scala愛好者聚會(2015上海) http://hongjiang.info/scala-shanghai-2015/

依賴注入
Cake Pattern與依賴注入 http://hongjiang.info/cake-pattern-and-di/
scala中的self type(自身類型)與依賴注入 http://hongjiang.info/scala-self-type-and-di/

發佈了29 篇原創文章 · 獲贊 2 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章