Grokking Functional Programming
Michał Płachta
  • MEAP began June 2014
  • Publication in Spring 2020 (estimated)
  • ISBN 9781617291838
  • 475 pages (estimated)
  • printed in black & white

Grokking Functional Programming is a practical book. Written especially for object-oriented programmers, it will help you map familiar ideas like objects and inheritance to FP concepts such as programming with immutable data, higher order functions, composing functions, concurrent programming and even the dreaded monad. And you'll be pleased to know that we skip the academic baggage of lambda calculus, category theory, and the mathematical foundations of FP in favor of applying functional programming to everyday programming tasks. At the end of the book, you'll be ready to pick a functional language and start writing useful software.

Table of Contents detailed table of contents

Part 1: The Functional Toolkit

1 Learning functional programming

1.1 Perhaps you picked up this book because…​

1.2 What do you need to know before we start?

1.3 How do functions look like?

1.4 Meet the function

1.5 When the code lies…​

1.6 Imperative vs declarative

1.7 Coffee Break: imperative vs declarative

1.8 Coffee Break Explained: imperative vs declarative

1.9 How useful is learning functional programming?

1.10 Leaping into Scala

1.11 Practicing functions in Scala

1.12 Getting our tools ready

1.13 Getting to know the Scala REPL

1.14 Writing your first functions!

1.15 How to use this book?

1.16 Summary

2 Pure functions

2.1 Why do we need pure functions?

2.2 Coding imperatively

2.3 Passing copies of the data

2.4 Breaking the code…​ again

2.5 Recalculating instead of storing

2.6 Focusing on logic by passing the state

2.7 Where did all the state go?

2.8 Difference between impure & pure functions

2.9 Coffee Break: refactoring to a pure function

2.10 Coffee Break explained: refactoring to a pure function

2.11 In pure functions we trust

2.12 Difficulty of staying pure…​

2.13 Pure functions and clean code

2.14 Coffee Break: pure or impure?

2.15 Coffee Break Explained: pure or impure?

2.16 Using Scala to write pure functions

2.17 Practicing pure functions in Scala

2.18 Testing pure functions

2.19 Coffee Break: testing pure functions

2.20 Coffee Break Explained: testing pure functions

2.21 Summary

3 Immutable values

3.1 The fuel for the engine

3.2 Another case for immutability

3.3 Can you trust this function?

3.4 Mutability is dangerous

3.5 Functions that lie…​ again

3.6 Fighting mutability by working with copies

3.7 Coffee Break: getting burnt by mutability

3.8 Coffee Break Explained: getting burnt by mutability

3.9 Introducing shared mutable state

3.10 State’s impact on programming abilities

3.11 Dealing with the moving parts

3.12 Dealing with the moving parts using FP

3.13 Immutable values in Scala

3.14 Building our intuitions about immutability

3.15 Coffee Break: The Immutable String API

3.16 Coffee Break Explained: The Immutable String API

3.17 Hold on…​ isn’t this bad?

3.18 Purely functional approach to the shared mutable state

3.19 Practicing immutable slicing and appending

3.20 Practicing immutable slicing and appending

3.21 Summary

4 Functions as Values

Part 2: The Functional Techniques

5 Pipelines & Comprehensions

6 Error Handling

7 Behaviors vs Data

8 Functions and Types

9 IO

10 Data Streams

11 Concurrency

12 Testing

Part 3: Applied Functional Programming

13 Case Study #1

14 Case Study #2

15 Case Study #3

About the Technology

Functional programming is more than just writing the same old code in Scala, Clojure, or Haskell. To grok FP—to really get it—you need to rewire your brain to see the world differently. We're here to help you flip the switch. Grokking Functional Programming teaches you first to break down problems in a new way so you can approach them from a FP mindset. Following carefully-selected examples with thorough, carefully-paced explanations, you'll immerse yourself in FP concept by concept. Along the way, exercises, checks for understanding, and even the occasional puzzler give you opportunities to think and practice what you're learning.

What's inside

  • Designing with functions instead of objects
  • Multiple learning approaches to help you grok each new concept
  • A practical programming-first teaching style
  • Programming with immutable collections
  • Writing concurrent programs with a functional style

About the reader

Examples use Scala as the teaching language, but this is not a Scala book. No prior knowledge of Scala or FP is required.

About the author

Michał Płachta started using Scala commercially in 2014 and has been an active contributor to the Scala and JVM communities since. He regularly speaks at conferences, runs workshops, and organizes meetups to help others become better at functional programming. You can find his blog at michalplachta.com.


Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $44.99 pBook + eBook + liveBook
MEAP eBook $35.99 pdf + ePub + kindle + liveBook
Prices displayed in rupees will be charged in USD when you check out.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks