<div dir="ltr">Hi all.<div><br></div><div>I am working on import *.csv file into haskell.</div><div><br></div><div>As you guys recommended, I built code for comparison human's age as follows.</div><div><br></div><div><div style="font-size:13px">data Person = Person {name:: String, age:: Int } deriving(Show)</div><div style="font-size:13px">data Relations = Friend | Older | Younger<br></div><div style="font-size:13px"><br></div><div style="font-size:13px">class Comparison a where</div><div style="font-size:13px"> compare:: a -> a -> Relations</div><div style="font-size:13px"><br></div><div style="font-size:13px">instance Comparison Person where</div><div style="font-size:13px"> compare (Person a b) (Person a b)</div><div style="font-size:13px"> | b1 == b2 = Friend</div><div style="font-size:13px"> | b1 > b2 = Older</div><div style="font-size:13px"> | b1 < b2 = Younger</div></div><div><br></div><div><div><br></div><div>Also, I have .csv file as follows.</div><div><br></div><div>name age</div><div>tom 19</div><div>jane 21</div><div><br></div><div>By using above code, I would like to apply the above code for .csv file.</div><div><br></div><div>What is the best for this purpose?</div><div><br></div><div>Sincerely,</div><div>JY</div>
</div></div>