There is a very nice introduction to the problem and the lens idea here: https://skillsmatter.com/skillscasts/4251-lenses-compositional-data-access-and-manipulation. You will have to register -- it's free and it's worth it: this site has a lot of really great talks on all kinds of programming topics.
Anyway, when watching the video I strongly encourage you to pause at the end of every slide, think about what has been said, and go back and play it again if needed. We've talked about all the fundamental stuff you need: functors, the ID and Const functors, mapping, etc., but it isn't easy to digest what he's saying at the pace of the video. Just slow down and think about it. It wouldn't be surprising to spend 90-120 minutes watching the hour-long talk. (You can skip over the part at the end where he talks about other stuff).