concept each movie in category functional programming
appears as: each movie

This is an excerpt from Manning's book Grokking Functional Programming.
In the first part of this chapter we will encode this algorithm as a purely functional pipeline—a sequential program. But before we do this, let’s try to use imperative approach first and discuss its problems.
The solution seems to be very straight-forward. We just need to map each movie and construct a string, right?
movies.map(movie => s”You may like ${movie.title}, “ + s”because you liked $author’s ${book.title}”)What’s the problem? We don’t have access to neither author nor book inside the body of the mapping function! We can only create a string based on the movie, which only contains a title.