Monadic Computation in Swift. Why?

Vijaya Prakash Kandel
iOS Software Engineer at Zalando, Germany

NSURLSession completion handler has 3 optional types giving us 8 permutations when all we care is either it failed or succeeded. Error handling is still neglected for the fact that Swift does not provide a construct that abstracts the rudimentary details of switch and conditionals. Most Objects and their associated methods are not composable.

Monadic Computation comes from Functional Programming which helps write composable functions while preserving failure context/side effects and provide better abstraction. Swift although not a functional programming language, can express monadic computations elegantly and can solve all the above-mentioned problems.

In the talk, I will show why do we need Monadic Computations and how we can implement in Swift. I will share real use case of monadic computations and how our team at Zalando is using this concept. There will be a short live coding to demonstrate that Monadic Computation can be expressed elegantly in Swift.

About speaker

Vijaya (BJ) is a passionate iOS Software Engineer working at Zalando SE. He does Swift at day, Haskell at evening. He believes functional programming is the way to move ahead. He writes blogs and articles on various ways to write effective programs. He talks at meetups and conduct workshop on new ideas.
All topics