Functional Programming in Scala
Paul Chiusano and Runar Bjarnason Foreword by Martin Odersky September 2014 ISBN 9781617290657
MANNING PUBLICATIONS: https://www.manning.com/books/functional-programming-in-scala GITHUB: https://github.com/fpinscala/fpinscala
PART 1 INTRODUCTION TO FUNCTIONAL PROGRAMMING
-
WHAT IS FUNCTIONAL PROGRAMMING? 1.1. The benefits of FP: a simple example 1.1.1. A program with side effects 1.1.2. A functional solution: removing the side effects 1.2. Exactly what is a (pure) function? 1.3. Referential transparency, purity, and the substitution model 1.4. Summary
-
GETTING STARTED WITH FUNCTIONAL PROGRAMMING IN SCALA 2.1. Introducing Scala the language: an example 2.2. Running our program 2.3. Modules, objects, and namespaces 2.4. Higher-order functions: passing functions to functions 2.4.1. A short detour: writing loops functionally 2.4.2. Writing our first higher-order function 2.5. Polymorphic functions: abstracting over types 2.5.1. An example of a polymorphic function 2.5.2. Calling HOFs with anonymous functions 2.6. Following types to implementations 2.7. Summary
-
FUNCTIONAL DATA STRUCTURES 3.1. Defining functional data structures 3.2. Pattern matching 3.3. Data sharing in functional data structures 3.3.1. The efficiency of data sharing 3.3.2. Improving type inference for higher-order functions 3.4. Recursion over lists and generalizing to higher-order functions 3.4.1. More functions for working with lists 3.4.2. Loss of efficiency when assembling list functions from simpler components 3.5. Trees 3.6. Summary