Wednesday, 4 June 2014

Swiftly Does It!

Welcome to a new blog dedicated to understanding the new Swift programming language introduced by Apple for creating iOS and OS X applications. In my day job I work creating Enterprise level F# and Scala applications with a heavily functional bias and the aim of this blog is to understand how elements of those languages can (or can't) be implemented in Swift.

Here's a quick example piece of F# to start us off.

Source: Wikipedia

Wouldn't it be nice if we could write something similar in Swift like this

Well you can! The code above is perfectly valid Swift - it's just missing definitions for map and filter and the important (|>) operator which we'll cover in the next post (Note Swift collections come with a prebuilt definition of map but we'll create a new one here just for demonstration purposes)

Follow me:

No comments:

Post a Comment