Blog Archives

flatMap vs compactMap

In Swift 4.1, the flatMap function was divided into two functions. One kept the same name: flatMap This method flattens a sequence. Let’s say we have a two-dimensional array: [sourcecode language=”javascript”] let a = [[0,1,2],[3,4,5]] [/sourcecode] We can use the

Tagged with: , ,
Posted in Swift

Swift – a history of the inspiration for ‘new’ concepts!

In studying Swift initially, I was quite interested to read about concepts that I wasn’t familiar with, and curious to know if these were brand new concepts invented by excited Apple engineers, or if they were inspired from other other languages.

Tagged with: , , ,
Posted in Swift