Foreword
Preface
Mission
Chapter 1: Why Functional Programming?
At a Glance
Confidence
Communication
Readability
Perspective
How to Find Balance
Resources
Summary
Chapter 2: The Nature Of Functions
What Is a Function?
Function Input
Named Arguments
Function Output
Functions of Functions
Syntax
What’s This?
Summary
Chapter 3: Managing Function Inputs
All for One
Adapting Arguments to Parameters
Some Now, Some Later
One at a Time
Order Matters
No Points
Summary
Chapter 4: Composing Functions
Output to Input
General Composition
Reordered Composition
Abstraction
Revisiting Points
Summary
Chapter 5: Reducing Side Effects
Effects on the Side, Please
Once Is Enough, Thanks
Pure Bliss
There or Not
Purifying
Summary
Chapter 6: Value Immutability
Primitive Immutability
Value to Value
Reassignment
Performance
Treatment
Summary
Chapter 7: Closure vs. Object
The Same Page
Look Alike
Two Roads Diverged in a Wood…
Summary
Chapter 8: Recursion
Definition
Declarative Recursion
Stack
Rearranging Recursion
Summary
Chapter 9: List Operations
Non-FP List Processing
Map
Filter
Reduce
Advanced List Operations
Method vs. Standalone
Looking for Lists
Fusion
Beyond Lists
Summary
Chapter 10: Functional Async
Time as State
Eager vs. Lazy
Reactive FP
Summary
Chapter 11: Putting It All Together
Setup
Stock Events
Stock Ticker UI
Summary
Appendix A: Transducing
Why, First
How, Next
What, Finally
Summary
Appendix B: The Humble Monad
Type
Loose Interface
Just a Monad
Maybe
Humble
Summary
Appendix C: FP Libraries
Stuff to Investigate
Ramda (0.23.0)
Lodash/fp (4.17.4)
Mori (0.3.2)
Bonus: FPO
Bonus #2: fasy
Summary
· · · · · · (
收起)
0 有用 2024 2022-04-23 18:14:55
GitHub[github.com/getify/Functional-Light-JS]/techniques about FP: 'Trampolines' in 'Tail Calls' in recursion, fusion and transduction in list operations.../Monad is a wrapper, wrap around a value a s... GitHub[github.com/getify/Functional-Light-JS]/techniques about FP: 'Trampolines' in 'Tail Calls' in recursion, fusion and transduction in list operations.../Monad is a wrapper, wrap around a value a set of behaviors, the data value within the behavior making itself into a data structure, a functor/What About Functional Architecture Patterns? (展开)
0 有用 盐午 2022-05-06 06:15:29
用了三年半的时间断续读完。蛮好读的一本书,在 JavaScript 和 functional programming 之间寻找一种平衡,也介绍了很多函数式编程的概念。
0 有用 wdpm 2021-03-09 23:22:23
读的是github在线版:https://github.com/getify/Functional-Light-JS。记录一下关键知识点:纯函数,函数的arity,闭包,柯里化,局部应用,懒惰求值(利用reducer里层嵌套fn,一层一层包装执行,例如fn2(fn1(..args))延迟执行),数学幂等性,Observable。总体而言,是一本挺费解的书籍。毕竟习惯上还是imperative比较直... 读的是github在线版:https://github.com/getify/Functional-Light-JS。记录一下关键知识点:纯函数,函数的arity,闭包,柯里化,局部应用,懒惰求值(利用reducer里层嵌套fn,一层一层包装执行,例如fn2(fn1(..args))延迟执行),数学幂等性,Observable。总体而言,是一本挺费解的书籍。毕竟习惯上还是imperative比较直观,functional 的方式比较抽象。 (展开)