The Many Faces of Map

Episode #13 • Apr 23, 2018 • Subscriber-Only

Why does the map function appear in every programming language supporting “functional” concepts? And why does Swift have two map functions? We will answer these questions and show that map has many universal properties, and is in some sense unique.

Collection
Map
The Many Faces of Map
Locked

Unlock This Episode

Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.

Sign in with GitHub

Introduction

Today’s topic is a big one, and it’s only the beginning of a long, deep journey. We want to consider the seemingly humble map function in all of its glory. Many people point to the presence of map in a language as being a strong indicator of the language having “functional” tendencies. You’ll often hear “language ABC has support for functional concepts like map, filter, reduce, etc”, and the mention of map is always first! Why is that?!

Swift must be doubly functional because it comes with two maps! One on arrays and one on optionals!

We want to build intuition for why map seems to be so ubiquitous in “functional-leaning” languages, and in fact there are lots of other maps lurking in the shadows of our everyday Swift code that we have yet to explore.

Swift’s maps


References

Downloads

Get started with our free plan

Our free plan includes 1 subscriber-only episode of your choice, access to 64 free episodes with transcripts and code samples, and weekly updates from our newsletter.

View plans and pricing