Home Page Icon
Home Page
Table of Contents for
Dedication
Close
Dedication
by Vlad Riscutia
Programming with Types
Copyright
Dedication
Brief Table of Contents
Table of Contents
Preface
Acknowledgments
About This Book
Who should read this book
How this book is organized: a road map
About the code
About the author
Book forum
About the Cover Illustration
Saint-Sauver
Chapter 1. Introduction to typing
1.1. Whom this book is for
1.2. Why types exist
1.3. Benefits of type systems
1.4. Types of type systems
1.5. In this book
Summary
Chapter 2. Basic types
2.1. Designing functions that don’t return values
2.2. Boolean logic and short circuits
2.3. Common pitfalls of numerical types
2.4. Encoding text
2.5. Building data structures with arrays and references
Summary
Answers to exercises
Chapter 3. Composition
3.1. Compound types
3.2. Expressing either-or with types
3.3. The visitor pattern
3.4. Algebraic data types
Summary
Answers to exercises
Chapter 4. Type safety
4.1. Avoiding primitive obsession to prevent misinterpretation
4.2. Enforcing constraints
4.3. Adding type information
4.4. Hiding and restoring type information
Summary
Answers to exercises
Chapter 5. Function types
5.1. A simple strategy pattern
5.2. A state machine without switch statements
5.3. Avoiding expensive computation with lazy values
5.4. Using map, filter, and reduce
5.5. Functional programming
Summary
Answers to exercises
Chapter 6. Advanced applications of function types
6.1. A simple decorator pattern
6.2. Implementing a counter
6.3. Executing long-running operations asynchronously
6.4. Simplifying asynchronous code
Summary
Answers to exercises
Chapter 7. Subtyping
7.1. Distinguishing between similar types in TypeScript
7.2. Assigning anything to, assigning to anything
7.3. Allowed substitutions
Summary
Answers to exercises
Chapter 8. Elements of object-oriented programming
8.1. Defining contracts with interfaces
8.2. Inheriting data and behavior
8.3. Composing data and behavior
8.4. Extending data and behavior
8.5. Alternatives to purely object-oriented code
Summary
Answers to exercises
Chapter 9. Generic data structures
9.1. Decoupling concerns
9.2. Generic data layout
9.3. Traversing any data structure
9.4. Streaming data
Summary
Answers to exercises
Chapter 10. Generic algorithms and iterators
10.1. Better map(), filter(), reduce()
10.2. Common algorithms
10.3. Constraining type parameters
10.4. Efficient reverse and other algorithms using iterators
10.5. Adaptive algorithms
Summary
Answers to exercises
Chapter 11. Higher kinded types and beyond
11.1. An even more general map
11.2. Monads
11.3. Where to next?
Summary
11.4. Answers to exercises
Appendix A. TypeScript installation and source code
Online
Local
Source Code
DIY
Appendix B. TypeScript cheat sheet
Types and possible values
Common algorithms
map()
filter()
reduce()
Index
List of Figures
List of Tables
List of Listings
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Copyright
Next
Next Chapter
Brief Table of Contents
Dedication
To my wife, Diana, for her infinite patience
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset