Acknowledgments
- About the book cover
Introduction
- Caveat Lector
- Why FP?
- Why Javascript?
- Why Typescript?
- Why FP-TS?
- Motivation for this book
- What you should know
- Overview
Tidbits: Some Useful Javascript and Typescript
- Requirements
- Setting up a new project
- More than one way to build a function
- Backticks for easy printing
- The ternary operator
- Discriminating unions
- Summary
First Steps with Functional Programming
- What is Functional Programming
- Pure functions, referential transparency and immutability
- Writing functional code
- Writing functional programs
- Monads
- Briefly about types again
- Summary
Our First Project: User Registration
- Defining our types
- Validation with Either
- Before we continue: Either or Validation?
- Creating our user with lifting
- Bringing it together
- Change is inevitable - how to cope with it
- Summary
Deploying a monitoring application
- AWS Lambda and SAM
- Setting up our project
- Using the Cloudwatch SDK
- Monads for asynchronous behavior
- Transforming our data
- Synchronous behavior and IO
- Bringing it all together
- Extensions
- A small aside: memoization
- Key points
- Summary
Testing
- The types of testing
- You mentioned TDD?
- FP and testing
- Property-based testing
- Other tools for better code
- Summary
Once more unto the breach: our final application
- Setting up
- Writing our first Create Lambda code
- Core logic of the Create Lambda
- Bringing it together
- Creating the Retrieve Lambda
- DynamoDB
- Adding the real database
- Summary
Expanding our reservation application
- Using the Reader Monad for gathering config
- Using State
- Better error types
- Restaurants and sequenceS
- Choosing configs
- Exploring some more ideas
- Summary
Rewriting an application
- The original application
- Evaluation
- Improvements overview
- Our new code setup
- Validation
- Dealing with the asynchronous calls
- Advantages of our functional approach
- Summary
Advanced FP techniques
- Domain Specific Languages
- Tagless final
- Free monads
- Executable and declarative encoding, algebraic design
- Summary
Conclusion
- What we learned
- Where to go from here
Appendix A: Additional Concepts
- Writer
- These