Masterclasses
GOTO Copenhagen 2019

Thursday Nov 21
09:00 –
16:00

Functional Programming in Swift

This course is for experienced Swift developers who are new to Functional Programming.

What you'll learn At the end of this day, you'll look at functions differently.

We begin by looking more closely at functions you use already. Next we explore higher order functions that either accept or return closures. We play with four canonical examples from the Swift Standard Library: map(), filter(), reduce(), and flatMap() and then create map() and flatMap() functions of our own.

We assume that you are an experienced programmer who has spent some time looking at Swift but you are new to Functional Programming. This course shows you how to add elements of a functional style to Object-Oriented and Protocol-Oriented Programming.

What you need You need a Mac running macOS 10.14 or macOS 10.15 with the latest version of Xcode 11 installed. You'll create Swift 5 playgrounds and iOS 13 projects throughout the day.

Syllabus Highlights
Understanding Functions

  • Function Parameters
  • Favor Immutability
  • Value Types
  • Mutating Methods
  • Non-mutating Methods
  • Embracing Generics

Higher Order Functions

  • Closures
  • Returning Closures
  • Consuming Closures
  • Custom Operators
  • Capture Lists

Swift Standard Library

  • Map
  • Filter
  • Reduce
  • FlatMap
  • Functors and Monads

More with Map

  • Collections
  • Optionals
  • Error
  • Result
  • Non-Containers
  • FlatMap (Optional)

Organized by