how can I remove this yield’s? I wanna use a map instead of:
val cols = for(x <- 0 to 6) yield for(y <- 0 to 5) yield apply(x, y)
Is this possible?
Thanks!
Best regards,
John
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That would be pretty simple:
UPD
There may be variations in
maps. If you want flat object without nested structure it is better to useflatMapinstead of justmap:or just flatten result at the end: