Anyone suggest .csv file parser?

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

On Sat, Nov 28, 2015 at 09:42:58PM -0500, Jeon-Young Kang wrote:
Hi all.
I am working on import *.csv file into haskell.
[..]
What is the best for this purpose?
I use http://hackage.haskell.org/package/csv and never had troubles with it. `parseCSV` returns a list of lists ([[String]]) which is easy enough to manipulate for whatever you need.

I'd recommend taking a look at cassava
https://hackage.haskell.org/package/cassava.
On Sat, Nov 28, 2015 at 9:54 PM, Francesco Ariis
On Sat, Nov 28, 2015 at 09:42:58PM -0500, Jeon-Young Kang wrote:
Hi all.
I am working on import *.csv file into haskell.
[..]
What is the best for this purpose?
I use http://hackage.haskell.org/package/csv and never had troubles with it. `parseCSV` returns a list of lists ([[String]]) which is easy enough to manipulate for whatever you need.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

Thanks for your recommendation.
Now, I am looking through cassava. I just got to know how to import *.csv
file to haskell.
Then, if I need calculate something (summary, dividing, and so on), can you
give me an example source code?
Sincerely,
On Sun, Nov 29, 2015 at 4:07 AM, Ryan Trinkle
I'd recommend taking a look at cassava https://hackage.haskell.org/package/cassava.
On Sat, Nov 28, 2015 at 9:54 PM, Francesco Ariis
wrote: On Sat, Nov 28, 2015 at 09:42:58PM -0500, Jeon-Young Kang wrote:
Hi all.
I am working on import *.csv file into haskell.
[..]
What is the best for this purpose?
I use http://hackage.haskell.org/package/csv and never had troubles with it. `parseCSV` returns a list of lists ([[String]]) which is easy enough to manipulate for whatever you need.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-- Department of Geography State University of New York at Buffalo jykang22@gmail.com Jeon-Young Kang
participants (3)
-
Francesco Ariis
-
Jeon-Young Kang
-
Ryan Trinkle