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:

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!

About Josh Smith

Josh Smith is a musician at heart, and a software developer by obsession. He lives in Arizona, plays classical music on the piano, jazz on the guitar, and enjoys brutally long rides on his bicycle. He has a wonderful wife & son and thinks that, in general, life is good.
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.