Fresh Swift
  • About
  • Tags
Fresh Swift

#functional


Intro to free functions in Swift

This is an excellent post from Jakub Turek on functional programming and free functions in Swift. Jakub guides us through a complete example of using free, generic and composable functions to transform complex data. The approach results in an implementation which is easier to both read and test. Definitely one to code along to in a playground.

Posted on June 14, 2020

#functional 

Functional Refactoring in Swift

Ben Scheirman explains what we need to consider when we begin refactoring our code to be more functional. Ben provides an example which demonstrates how we can iterate on our refactoring to find the best version.

Posted on May 19, 2018

#functional  #refactoring 

Swift Tip: First Class Functions

This short post from the objc.io team looks at first class functions in Swift. First class functions are a really great functional feature of Swift, allowing us to use functions as function parameters, as property types, or as function return types.

Posted on May 17, 2018

#functional 

Functional Refactoring in Swift

In this post, Ben Scheirman demonstrates how we can refactor some common imperative code using a functional approach. It’s good to see an example of the zip operation being used, as it’s an operation I have neglected to consider in the past.

Posted on March 16, 2018

#functional  #refactor 

Transforming collections in Swift

In this entry of his regular Swift blog series, John Sundell looks at how we can transform collections using standard library APIs. No doubt most of us are familiar with map, flatMap etc., but it’s good to refresh our knowledge. Also, I tend to forget about the zip function, so I was happy to be reminded of it’s usefulness.

Posted on February 13, 2018

#collection  #functional 

Using Lazy to Delay Computation

Short post reminding us that Swift’s lazy modifier can be used for more than just property declarations.

Posted on February 10, 2018

#lazy  #functional 

Why the Func

Daniel Steinberg with a talk from AltConf 2017 in which he looks at what functional programming means in Swift. He takes a deep dive in to using map, and shows us what we can learn from trying to write our own map functions.

Posted on August 3, 2017

#talk  #functional  #map 

Higher order functions in Swift

Swift's functional aspects such as immutability and higher order functions (functions which allow functions/closures as parameters/return values) are awesome. In this post, Craig Grummitt looks at the latter, presenting examples of how we can use Swift's higher order functions to perform operations on collections.

Posted on May 25, 2017

#functional  #higherorder 

 •  2021  •  Fresh Swift

Hugo v0.81.0 powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo