Hands-On Functional Programming with TypeScript
图书信息
| 作者 | Remo H. Jansen |
| 出版社 | Packt Publishing |
| ISBN | 9781788838184 |
| 出版时间 | 2019-01-30 |
| 字数 | 23.5万 |
| 分类 | 进口书,外文原版书,电脑,网络 |
读书简介
Discover the power of functional programming, lazy evaluation, monads, concurrency, and immutability to create succinct and expressive implementations Key Features * Get a solid understanding of how to apply functional programming concepts in TypeScript * Explore TypeScript runtime features such as event loop, closures, and Prototypes * Gain deeper knowledge on the pros and cons of TypeScript Book Description Functional programming is a powerful programming paradigm that can help you to write better code. However, learning functional programming can be complicated, and the existing literature is often too complex for beginners. This book is an approachable introduction to functional programming and reactive programming with TypeScript for readers without previous experience in functional programming with JavaScript, TypeScript , or any other programming language. The book will help you understand the pros, cons, and core principles of functional programming in TypeScript. It will explain higher order functions, referential transparency, functional composition, and monads with the help of effective code examples. Using TypeScript as a functional programming language, you’ll also be able to brush up on your knowledge of applying functional programming techniques, including currying, laziness, and immutability, to real-world scenarios. By the end of this book, you will be confident when it comes to using core functional and reactive programming techniques to help you build effective applications with TypeScript. What you will learn * Understand the pros and cons of functional programming * Delve into the principles, patterns, and best practices of functional and reactive programming * Use lazy evaluation to improve the performance of applications * Explore functional optics with Ramda * Gain insights into category theory functional data structures such as Functors and Monads * Use functions as values, so that they can be passed as arguments to other functions Who this book is for This book is designed for readers with no prior experience of functional programming with JavaScript, TypeScript or any other programming language. Some familiarity with TypeScript and web development is a must to grasp the concepts in the book easily.
目录
Title Page
Copyright and Credits
Hands-On Functional Programming with TypeScript
Dedication
About Packt
Why subscribe?
Packt.com
Foreword
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Functional Programming Fundamentals
Is TypeScript a functional programming language?
The benefits of functional programming
Introducing functional programming
Pure functions
side-effects
Referential transparency
Stateless versus stateful
Declarative versus imperative programming
Immutability
Functions as first-class citizens
Lambda expressions
Function arity
Higher-order functions
Laziness
Summary
Mastering Functions
Function types
Named and anonymous functions
Function declarations and function expressions
Working with function parameters
Trailing commas in function arguments
Functions with optional parameters
Functions with default parameters
Functions with rest parameters
Function overloading
Specialized overloading signature
Function scope and hoisting
Immediately-invoked functions
Tag functions and tagged templates
Summary
Mastering Asynchronous Programming
Callbacks and higher-order functions
Arrow functions
Callback hell
Promises
Covariant checking in callback parameters
Generators
Asynchronous functions – async and await
Asynchronous generators
Asynchronous iteration (for await…of)
Delegating to another generator (yield*)
Summary
The Runtime – The Event Loop and the this Operator
The environment
Understanding the event loop
Frames
Stack
Queue
Heap
The event loop
The this operator
The this operator in the global context
The this operator in the function context
The call, apply, and bind methods
Summary
The Runtime – Closures and Prototypes
Prototypes
Instance properties versus class properties
Prototypal inheritance
Prototype chains and property shadowing
Accessing the prototype of an object
Closures
Static variables powered by closures
Private members powered by closures
Summary
Functional Programming Techniques
Composition techniques
Composition
Partial application
Currying
strictBindCallApply
Pipes
Other techniques
Point-free style
Recursion
Pattern matching
Summary
Category Theory
Category theory
Functors
Applicative
Maybe
Either
Monads
Summary
Immutability, Optics, and Laziness
Immutability
Optics
Lenses
Prisms
Laziness
Summary
Functional-Reactive Programming
Reactive programming
Functional programming versus functional-reactive programming
The benefits of functional-reactive programming
Working with observables
The observer pattern
The iterator pattern
Creating observables
Creating observables from a value
Creating observables from arrays
Creating observables from events
Creating observables from callbacks
Creating observables from promises
Cold and hot observables
Working with operators
Pipe
Max
Every
Find
Filter
Map
Reduce
Throttle
Merge
Zip
Summary
Real-World Functional Programming
Working with Ramda
Composition
Partial application and currying
Lenses
Working with Immutable.js
Working with Immer
Working with Funfix
Summary
Functional Programming Learning Road Map
Beginner
Advanced beginner
Intermediate
Proficient
Expert
Summary
Directory of TypeScript Functional Programming Libraries
Functional programming
Category theory
Laziness
Immutability
Optics and lenses
Functional-reactive programming
Others
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
- 北大国学课(文章)
- 中华学生百科全书——控制论与自动化(读书堂)
- GBT 51338-2018 分布式电源并网工程调试与验收标准(电力企业联合会)
- 中国企业家成长30年:企业家精神引领企业迈向高质量发展(李兰)
- 县域经济破局:数智化驱动县域发展新模式(刘丁蓉,华崇鑫,朱建良)
- 《新东方英语》中学生2014年12月号(《新东方英语》编辑部)
- 分开以后我变成了你喜欢的样子(Josie乔)
- 2020—2021年中国战略性新兴产业发展蓝皮书(精装版)(中国电子信息产业发展研究院)
