Function composition in Swift

The way that functional programming languages allow functions to be combined can help make code easier to read and understand. The technique is known as function composition. I show how to compose functions in Swift 3 using custom operators, including a function composition operator that supports optional chaining semantics. It’s available in this GitHub repository:

https://github.com/ijoshsmith/function-composition-in-swift

The article can be read on that repository’s home page, and it’s also available in an Xcode playground. This allows you to experiment with the presented code and immediately see the results. Have fun!

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

1 Response to Function composition in Swift

  1. Pingback: Dew Drop - January 25, 2017 (#2407) - Morning Dew

Comments are closed.