Home Page Icon
Home Page
Table of Contents for
Becoming Functional
Close
Becoming Functional
by
Preface
Who Is This Book For?
Math Notation Review
Why Functional over Imperative?
Why Functional Alongside OOP?
Why Functional Programming Is Important
Conventions Used in This Book
Using Code Examples
SafariĀ® Books Online
How to Contact Us
Acknowledgments
1. Introduction
Overview of Concepts in Functional Programming
First-Class Functions
Pure Functions
Recursion
Immutable Variables
Nonstrict Evaluation
Statements
Pattern Matching
Functional Programming and Concurrency
Conclusion
2. First-Class Functions
Introduction to XXY
Functions as Objects
Refactoring Using If-Else Structures
Refactoring Using Function Objects to Extract Fields
Anonymous Functions
Lambda Functions
Closures
Higher-Order Functions
Refactoring get Functions by Using Groovy
Conclusion
3. Pure Functions
Output Depends on Input
Purifying Our Functions
Side Effects
Conclusion
Making the Switch to Groovy
4. Immutable Variables
Mutability
Immutability
Conclusion
5. Recursion
An Introduction to Recursion
Recursion
Tail Recursion
Refactoring Our countEnabledCustomersWithNoEnabledContacts Function
Conclusion
Introducing Scala
6. Strict and Nonstrict Evaluations
Strict Evaluation
Nonstrict (Lazy) Evaluation
Laziness Can Create Problems
Conclusion
7. Statements
Taking the Plunge
Simple Statements
Block Statements
Everything Is a Statement
Conclusion
8. Pattern Matching
Simple Matches
Simple Patterns
Extracting Lists
Extracting Objects
Converting to Pattern Matches
Conclusion
9. Functional OOP
Static Encapsulation
Objects As Containers
Code as Data
Conclusion
10. Conclusion
From Imperative to Functional
Introduce Higher-Order Functions
Convert Existing Methods into Pure Functions
Convert Loops to Tail/Recursive-Tail Methods
Convert Mutable Variables into Immutable Variables
What Next?
New Design Patterns
Message Passing for Concurrency
The Option Pattern (Extension of Null Object Pattern)
Object to Singleton Method Purity
Putting It All Together
Conclusion
Index
Colophon
Copyright
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
Cover
Next
Next Chapter
Preface
Becoming Functional
Joshua
Backfield
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