《Functional-Light JavaScript》简介:
Functional-Light JavaScript is a balanced, pragmatic exploration of Functional Programming in JavaScript.Functional Programming (FP) is an incredibly powerful paradigm for structuring code that yields more robust, verifiable, and readable programs. If you've ever tried to learn FP but struggled with terms like "monad", mathematical concepts like category theory, or symbols like (lambda), you're not alone.Functional-Light programming distills the most vital aspects of FP—function purity, value immutability, composition, and more!—down to approachable JavaScript patterns. Rather than the all-or-nothing dogmatism often encountered in FP, this book teaches you how to improve your programs line by line.
《Functional-Light JavaScript》目录:
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
· · · · · ·