I was looking at the scalaz tutorial at http://eed3si9n.com/learning-scalaz/Applicative.html
and i saw this code :(List("ha", "heh", "hmm") |@| List("?", "!", ".")) {_ + _}
the result was res63: List[String] = List(ha?, ha!, ha., heh?, heh!, heh., hmm?, hmm!, hmm.)
i could write this code more readable by using a for loop i.e
for {
a1 <- List("ha", "heh", "hmm")
a2 <- List("?", "!", ".")
} yield {a1 +a2}
i have saw more examples and tried to understand why should i use applicative at all. mostly i can use the map\flatMap functions to deal with all applicative examples.
Can someone give a truely usefull example why should i use it at all?