map versus flatMap

Note: The goal of this post is to give the reader an intuition about the usage of a map versus a flatMap, instead of playing around with return types of each operation, until you pick the one that suits. A recurring topic during our interview process is "what's the…

Monads

Note: This is an exploratory post, where I will write about some ideas that are still fresh in my mind and need consolidation. Any mistake, lack of objectivity/rigor, that you find, please let me know. I also tried to balance between being practical and respecting the nomenclature. I started…

McFlurryâ„¢

While working with RAC 3.0, I find myself in this situation a lot[1]: aSignal.flatMapLatest { v in transformation(v) } Which can be simplified into: aSignal.flatMapLatest(transformation) The problem is when our transformation, doesn't really fit what we need. func fileCreationDate(fullPath: String) -> SignalProducer<NSDate,…

Map and Flatmap

This week, I explained to my colleagues what's the difference between a map and a flatMap[1]. The trick was: focus on the types and leave the burritos for lunch time. Monads and cheese pic.twitter.com/nT3DJ51qXt— R. Peres (@RuiAAPeres) July 24, 2015 Map [a] -> (a…