Hi all.

I am working on import *.csv file into haskell.

As you guys recommended, I built code for comparison human's age as follows.

data Person = Person {name:: String, age:: Int } deriving(Show)
data Relations = Friend | Older | Younger

class Comparison a where
    compare:: a -> a -> Relations

instance Comparison Person where
    compare (Person a b) (Person a b)
         | b1 == b2 = Friend
         | b1 > b2 = Older
         | b1 < b2 = Younger


Also, I have .csv file as follows.

name age
tom 19
jane 21

By using above code, I would like to apply the above code for .csv file.

What is the best for this purpose?

Sincerely,
JY