learn:functional-programming
**這是本文件的舊版!**
目錄表
Functional Programming 筆記
Library
值 vs Functor
f | g | composition |
---|---|---|
pure | pure | compose(f, g) |
effects | pure(unary) | f.map(g) |
effects | pure(n-ary) | f1.map(g).ap(f2) |
effects | effects | m.chain(f).chain(g) |
Functor
Either
- 處理錯誤情境
- 分成
Either.Right
和Either.Left
Either.Right
會繼續跑,而Either.Left
則會忽略後續運算,執意將手上的值傳下去
Future
TODO
Identity
TODO
IO
- 處理永不失敗的同步計算
Maybe
- 處理無值情境 ( null || undefined )
Reader
- 用來避免中間傳送無用的
dep
Tuple
TODO
State
* <https://ithelp.ithome.com.tw/articles/10280554>
Articles
learn/functional-programming.1655799571.txt.gz · 上一次變更: 2024/12/22 21:17 (外部編輯)