My solution to the assignment of the course 'Functional Programming Principles in Scala'