I am trying to figure out a program that can only be done with map function and not for - yield function. I did figure out a program that can only done using for yield and it can’t be just done using map alone, it requires map and filter.
for {
i <- 1 until n
j <- 1 until i
if isPrime(i + j)
} yield (i, j)
This is an example i found out from an online course. Similarly i am trying to figure out an example where it can be only run using map function and not for yield construct.