# A Functional Programming Kickstart

There's nothing natural about Functional Programming. It's awkward, it feels funny, ...

And then one day you start to see the world differently and you can't remember what was so difficult.

A Functional Programming Kickstart is a hands-on, fast-moving kickstart will provide you with a new set of skills that you can add to - not replace - your current favorite programming techniques. In no time you’ll be creating and using higher-order functions, embracing value types, avoiding side-effects, and digging deep into map(), flatMap(), and apply().

#### Part One

You use functions and methods to get things done but have you ever thought that those things you do with Strings, Ints, and other types can also be done with functions. We begin this book by learning how to construct functions that are safe to use and to pass around.

Pass around?

Sure. You can store functions as properties, create functions that return other functions, and create and use functions that accept other functions. In no time this book will have you creating these so-called higher-order functions and exploring many provided for you in the Swift Standard Library.

Chapter 1 Magic

Chapter 2 Functions aren't special

Chapter 3 Higher-order Functions

Chapter 4 Arrays

#### Part Two

Once you’ve explored map() and flatMap() for Arrays you are prepared to take things to a whole other level. We work to see map() and flatMap() as design patterns and not just as functionality we’re given for collections. We’ll see map() as pattern by extending examples provided for Array, Optionals, and the Result type. Once you have the big idea of map() down you’ll understand all the fuss about functors.

This prepares you to look at flatMap() and see how map() allows us to transform a result but flatMap() allows us to interact with our environment. In addition to built in types, and illustrative types we explore the Writer, Reader, and State monads. Understanding this broader context will help you apply the standard bits of the standard library with more confidence and prepare you to master the Combine frameworks.

Chapter 5 Map

Chapter 6 FlatMap

Chapter 7 Apply

Chapter 8 Deeper Magic

#### What you need

You need a Mac running the latest public release of Xcode.

The code in this book is Swift 5.3 and runs on Xcode 12 on Mac OS Big Sur. It has been tested on Apple Silicon.

You've purchased this product

Sorry, this item is not available in your location.
Sold out, please go back and pick another option.

0 ratings

Checkout

#### Card

···· ···· ···· 4242
Test card

05/18

#### Card

Use a different card?

#### Card

or pay with

We do not keep any of your sensitive credit card information on file with us unless you ask us to after this purchase is complete.

or pay with

You'll be charged US\$30.