Kodeco Forums

An Introduction to Functional Programming in Swift

In this tutorial you will learn the basics of functional programming in Swift to solve problems.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/693-an-introduction-to-functional-programming-in-swift
1 Like

Thanks for sharing!
Awesome article!

Error in let waitTime: Minutes

Playground execution failed: error: FunctionalSwift.playground:13:19: error: use of undeclared type ‘Minutes’
let waitTime: Minutes

Should be “let waitTime: minutes” … small M?

XCode Version 8.2.1 (8C1002)

Thanks so much. Such a brilliant article

Thanks so much for such a clear introduction to the FP concepts. Coming from a C background where there are lots of side effects I need lots of help :grinning:

When implementing the extension on RideCategory, I get a compiler error that suggest changing rawValue to hashValue. Then when I let it change it to hashValue, it gives me another error saying that it cannot convert return expression of type ‘Int’ to return type ‘String’

In the section on Map, the final implementation of sortedNames should be changed from let rideNames = parkRides.map { $0.name } to let rideNames = rides.map { $0.name } so that it uses the local reference to the collection of rides.

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]