A blog exploring functional programming and Swift.

2019 Year-in-review

Monday Dec 30, 2019

It’s the end of the year again, and we’re feeling nostalgic 😊. We’re really proud of everything we produced for 2019, so join us for a quick review of some of our favorite highlights.

We are also offering 30% off the first year for first-time subscribers. If you’ve been on the fence on whether or not to subscribe, now is the time!

Episodes

In 2018, we spread our attention across many important topics in functional programming so that we could get a firm foundation in the tools that functional thinking gives us. Things like functions, algebraic data types, map, contravariance, zip, protocol witnesses and more. This set the stage for 2019.

This year we produced 45 episodes (12 of them free!) for a total of 19 hours of video, and we focused on fewer topics and spent more time diving really deep into the concepts. We ended up leveraging almost everything we covered in 2018 in some shape or form. The basic units of composition from 2018 just kept appearing over and over again.

Here’s a summary of the broad topics we explored:

FlatMap

We started the year out with a 5-part series on flatMap. Last year we saw that the map and zip operations were powerful and universal, and that many types support these operations, not just arrays and optionals. The map operation allows us to access the value inside any generic context and apply a transformation to it. On the other hand, zip allows us to do something similar, except when you want to apply a transformation to many generic contexts at once.

Those transformations are powerful, and allow us to express many things, but there are still things we want to do with certain types that map and zip alone cannot do. This is what motivates flatMap! It is precisely the operation that allows us to chain together computations, whether it be computations on optionals, results, arrays or async values.

Random Number Generators

Last year we set the foundation for the atomic unit of randomness, Gen, from which more complex randomness can be derived (part 1, part 2, part 3), but this year we took it to the next level. By making a very small change to the definition of our Gen type, we are able to gain testability in our randomness, and we spent 2 🆓 episodes exploring how to make generative art with the Gen type:

Enum Properties

Although structs and enums have first class treatment in Swift and are awesome to use, structs tend to have nicer ergonomics than enums. We explored what it would look like for enums to get many of the affordances that structs have, and we built a CLI tool (with SwiftSyntax!) to generate a friendlier API for enums.

Parsers

We explored what functional programming has to say about parsers, and it turns out it has quite a bit to say! After exploring various API’s for parsers that we interact with in the Apple ecosystem, we distilled the essence of parsing into a single function signature. That signature led us to discover many amazing composability properties, and we demonstrated how lots of tiny parsers could be pieced together to form very complex parsers.

SwiftUI

We were very excited when SwiftUI was announced at WWDC. Its core ideas are rooted in some concepts that are well-supported by functional programming, such as view functions and declarative programming, and we knew we’d have a lot to say about it.

We started off by exploring what SwiftUI gives us out of the box so that we could understand what areas of application development it excels at, and where there is room for improvement. We released 3 free episodes showing how SwiftUI approaches the problems of state management, as well as a later free episode for how to do snapshot testing in a SwiftUI application.

Composable Architecture

Although SwiftUI solves some of the most complex problems we face building applications, it doesn’t solve all of them. We turned to functional programming to develop an architecture that attempts to solve 5 precise problems that every application faces, and that we feel every architecture story must account for:

  1. How to model the architecture using value types
  2. How to break down large features into smaller pieces
  3. How to isolate parts of the app into their own modules so that they don’t depend on each other
  4. How to model side effects in the architecture
  5. And how to test the architecture.

It took us a whopping 19 (‼️) episodes to accomplish this, and the results have been amazing.

🎉 2020 🎉

It was an incredible year, and thanks to all of our subscribers for supporting us and helping us create this content. We have a lot of great things planned for 2020: we have a few more things to discuss about the Composable Architecture, we have a few more advanced parser topics we want to cover, as well as some completely new topics and an exciting new project to announce!

To celebrate the end of the year we are also offering 30% off the first year for first-time subscribers. If you’ve been on the fence on whether or not to subscribe, now is the time!

See you in 2020!


Subscribe to Point-Free

👋 Hey there! If you got this far, then you must have enjoyed this post. You may want to also check out Point-Free, a video series on functional programming and Swift.