Training | Functional Programming Fundamentals with Swift and Bow

Training about how to learn Functional Programming essentials from scratch using Bow.

24-30 hours
fundamentals

Overview

Swift has built-in features that make it very suitable for functional programming (FP) such as high-order functions, value semantics, and protocol-oriented programming. Also, optional types and collections include functional combinators such as map and flatMap to transform and chain computations in a functional way. However, it still lacks abstractions and data types to enable full-fledged FP in the language. Bow is a Swift library that aims to cover that gap.

In this course, we will introduce what is Functional Programming and how Swift can be used with Bow to write code in a more functional style.

Prerequisites

  • Experience with Swift.
  • A computer with macOS and Xcode.

What you'll learn

Introduction to Functional Programming

  • What is Functional Programming
  • Swift features for Functional Programming: high-order functions, value types, protocols, optionals, functional combinators.
  • Referential Transparency.
  • The Substitution Model

Domain modeling with Algebraic Data Types

  • Product types: structs, tuples, and classes.
  • Coproduct types: enumerations.

Basic Error Handling and Data validation

  • Types for error handling: Option, Try, Either, Validated.
  • Fail fast and error accumulation strategies for error handling.

Working with Immutable Data with Optics

  • Focusing on deeply nested data with Lens, Prism, and Optional
  • Composition of optics.

Higher-Kinded Types

  • What are Higher-Kinded Types?
  • Introduction to polymorphic programs
  • Polymorphic functions
  • Swift support of HKTs and simulation of HKTs with Bow.

Programming with the core functional type classes

  • Modeling Generic Behaviors with Type Classes
  • Transforming data with Functor
  • Independent computations with Applicative
  • Dependent Computations with Monad
  • Folding structures into summary values with Foldable
  • Traversing nested effects
  • Lawful and Lawless instances

Working with Effects

  • Dependency Injection alternative with Reader, Kleisli, Extension Functions
  • Removing Callback-Hell and nested lambdas
  • The rise of Tagless Final
  • Suspending side effects for deferred evaluation
  • Safe resource acquisition and release
  • Integrating with third-party sync and async libraries: RxSwift, BrightFutures
  • Testing Effectful Tagless Final programs

Polymorphic Error Handling

  • Modeling and raising errors
  • Fail Fast and Error Accumulating strategies with ApplicativeError and MonadError

Are you interested in scheduling this training for your company?

Contact us

Are you interested in attending a public training course?

Contact us

Alexandru Simonescu

“I’ve been developing software for more than ten years, and I think that learning functional programming through this training opened my mind and gave me more tools to solve my daily tasks in a more efficient way.”

Ilia Berlana

“This training was amazing. It gave me a new point of view about programming. I’ve been programming in Java for ten years in the backend on Android, and my next challenge is Kotlin, and this training helped me a lot.”

Juan Carlos García

“I’m very happy because I learned a lot, and I got some new tools I can use in my work day-to-day.”