From Josh Suereth’s “Scala in Depth”:
“Applicative functors provide a way to take two computations and join them together using a function. The Traversable example highlights how two collections can be parallelized into pairs. Applicative functors and parallel processing go together like bread and butter.”
I have a vague idea of the whole functors/monads/applicative stuff, but not exactly a strong grasp of it (new to the whole monad, functor stuff). I understand a bit of the concept of monads (flatten, flatMap) and monadic workflow, and functors (maps).
Can anyone please elaborate for me in terms of how it’s done, examples, and/or benefits of it versus “traditional” parallelization?
I forwarded the question to Josh Suereth. This is his reply:
Mike –
(note these code snippets are non-compilable examples; I was using SBT’s applicative syntax with the concepts in Scalaz, so you need to choose a library to use applicatives and what they are applying onto)