<div dir="ltr">Hi all.<div><br></div><div>I'd like to apply lookup function (Data.Map) for what I am working on.</div><div><br></div><div>Here is my code.</div><div><br></div><div>data Person = Person {personId :: Int, name = String}</div><div>data People = [Person]</div><div><br></div><div>data State = InMembership | NoMemebership</div><div><br></div><div>person1 = Person {1 = personId, "James" = name}</div><div>person2 = Person {2 = personId, "Tom" = name}</div><div><br></div><div>members = People [person1, person2]</div><div><br></div><div>class Belonging a where</div><div>      belonging :: a -> [a] -> Bool -> State</div><div><br></div><div>here is the problem...</div><div>I don't know how to get to know whether a person is belong to members.</div><div>I'd like to find it through a person's name.</div><div><br></div><div>Can you suggest any examples??</div><div><br></div><div>Sincerely,</div><div>Jeon <br></div><div> </div><div>   </div><div>
</div></div>