Getting a data class from a given value of that class in Haskell
<p>I have two definitions that</p>

<pre><code>data Person = Person Name Surname [Projects]
data Employees = Employees [Person] Salary
</code></pre>

<p>And I want to get the corresponding person from a given name by using the person list in employee and make some changes in the corresponding person. For example, I want to add a project to the list of project of the person that I want to do the project. How can I do this in Haskell? </p>

<p>The function signature should be like</p>

<pre><code>myfunction :: Employees -&gt; Name -&gt; Employees
</code></pre>