I am new to functional programming and ramda. I have a case, which can be solved in the imperative way quite easy, but I struggle with the declarative way. I have the following