concept Artist in category functional programming

This is an excerpt from Manning's book Grokking Functional Programming.
case class Artist(name: String, genre: String, origin: String)
⤤
What problems do you see with this definition of an artist?
There are many problems with this approach, but they all can be summarized as: this data model makes the implementation based on it harder and more error-prone. Compiler allows many invalid instances and it forces programmers to handle instances like: Artist(“”, “”,””) or make sure they won’t make mistakes like Artist(“Metallica”, “U.S”, “Heavy Metal”) in the code. (Do you see what the problem is with the latter value?) These kinds of mistakes are easy to make, they are not checked by the compiler and they are pretty hard to debug in many cases. Funny thing is that they all originate from using raw types to model real-world, more complicated business entities and relations.
This is just a simplified version of an Artist definition we’ll work with in this chapter. We will define the complete set of requirements soon.
So far we’ve used Strings or Ints to describe the data we used in our pure functions. In this chapter we can finally try to be better at data modeling. There are multiple problems which we will list, explain, and propose a functional solution to. You will learn how to model data to make the implementation a lot easier. First, we will model the Artist using only things we’ve learned in previous chapters and raw types. Then we will discuss and analyze each possible mistake a programmer could make using this naive model. Solutions will come next. Let’s go!
Some experience from object-oriented world will come in handy as well!
