Want it or not, functional programming is here to stay. Even more mainstream languages are adopting functional concepts and getting inspiration out of functional languages, so if you haven’t started looking into it yet don’t waste any more time!
If you are doing Swift development you should definitely pay attention to these 5 awesome functional programming libraries:
Swiftz
Swiftz is a Swift library for functional programming. It defines functional data structures, functions, idioms, and extensions that augment the Swift standard library. It draws inspiration from a number of functional libraries and languages. Chief among them are Scalaz, Prelude/Base,SML Basis, and theOCaml Standard Library. Elements of the library rely on their combinatorial semantics to allow declarative ideas to be expressed more clearly in Swift.
Swiftz implements higher-level data types like Arrows, Lists, HLists, and a number of typeclasses integral to programming with the maximum amount of support from the type system.
RxSwift
Rx is a generic abstraction of computation expressed through Observable<Element> interface. RxSwift is a Swift version of Rx and, like the original Rx, it intends to enable easy composition of asynchronous operations and event/data streams.
KVO observing, async operations and streams are all unified under abstraction of sequence. This is the reason why Rx is so simple, elegant and powerful.
Argo
Argo is a library that lets you extract models from JSON or similar structures in a way that’s concise, type-safe, and easy to extend. Using Argo, you won’t need to write validation code to ensure that incoming data is of the right type, or to make sure required data fields aren’t turning up empty. Argo uses Swift’s expressive type system to do that for you, and reports back explicit failure states in case it doesn’t find what you’ve told it to expect.
Tyro
Tyro is another Swift library for Functional JSON parsing and encoding. It has roots in Swiftz and draws inspiration from Aeson (from Haskell) and Argo.
Focus
Focus is an Optics library for Swift (where Optics includes Lens, Prisms, and Isos) that is inspired by Haskell’s Lens library.