Re: [Haskell-cafe] csv one-liner

2008-10-02 Thread Marco TĂșlio Gontijo e Silva
Op woensdag 01-10-2008 om 18:59 uur [tijdzone -0700], schreef Jason Dusek: Reply to all? No. Reply-to-list is a different thing. When you reply-to-all to a person who is in the list, the person gets two copies of the e-mail with different headers, which messes with filters and replies.

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Ketil Malde
Derek Elkins [EMAIL PROTECTED] writes: parseCSVFromFile in.csv = return . either (const error!) Whenever you see this = return . f pattern think liftM or fmap or $. ...and return . f = action is just action . f, no? -k -- If I haven't seen further, it is by standing in the footprints of

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Derek Elkins
On Wed, 2008-10-01 at 10:15 +0200, Ketil Malde wrote: Derek Elkins [EMAIL PROTECTED] writes: parseCSVFromFile in.csv = return . either (const error!) Whenever you see this = return . f pattern think liftM or fmap or $. ...and return . f = action is just action . f, no? Well actually

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Andrew Coppin
wman wrote: Long story short, I promised him a one-liner to show the power and beauty of Haskell. (writeFile output.csv) = (liftM printCSV $ liftM (map updateLine) $ parseCSVFromFile input.csv) Is there room for improvement ? Um... Does anybody else find it interesting that we are showing

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread wman
Thats why i put those quotation marks around that part of sequence ;-)) AFAIK one-liners never were about comprehensibility, just about what you can cram into one line of code. Any programmer should have no problems guessing what the line does does (even more so when looking at the final version

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Brandon S. Allbery KF8NH
On Oct 1, 2008, at 15:51 , Andrew Coppin wrote: wman wrote: Long story short, I promised him a one-liner to show the power and beauty of Haskell. (writeFile output.csv) = (liftM printCSV $ liftM (map updateLine) $ parseCSVFromFile input.csv) Is there room for improvement ? Um... Does

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Martin DeMello
2008/10/1 wman [EMAIL PROTECTED]: PS: Sorry, Andrew, that I first posted the reply directly to you, still getting used to the fact that gmail kindly replies to the user on whose behalf the message was sent, not to the list. I think that's a list setting, not a gmail one. martin

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread wman
On Wed, Oct 1, 2008 at 10:40 PM, Andrew Coppin [EMAIL PROTECTED]wrote: Maybe I should start a new tradition where Haskellers have a blob of Haskell as their sig? (I can't *wait* to see what the luminaries such as dons, dcoutts and igloo come up with...) Some haskell equivalent of :

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Claus Reinke
(writeFile output.csv) = (liftM printCSV $ liftM (map updateLine) $ parseCSVFromFile input.csv) Um... Does anybody else find it interesting that we are showing the beauty of Haskell by attempting to construct the most terse, cryptic, unmaintainable tangle of point-free code I don't agree at

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Marco TĂșlio Gontijo e Silva
Op woensdag 01-10-2008 om 13:25 uur [tijdzone -0700], schreef Martin DeMello: 2008/10/1 wman [EMAIL PROTECTED]: PS: Sorry, Andrew, that I first posted the reply directly to you, still getting used to the fact that gmail kindly replies to the user on whose behalf the message was sent, not

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Jason Dusek
Reply to all? -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] csv one-liner

2008-09-30 Thread wman
I got asked how to do one particular thing in excel, which led to discssion with our local MSOffice expert. During the discussion I stated that's it too much of a PITA and that I'd rather write a script. Long story short, I promised him a one-liner to show the power and beauty of Haskell. I got

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Henning Thielemann
On Tue, 30 Sep 2008, wman wrote: I got asked how to do one particular thing in excel, which led to discssion with our local MSOffice expert. During the discussion I stated that's it too much of a PITA and that I'd rather write a script. Long story short, I promised him a one-liner to show the

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Graham Fawcett
2008/9/30 wman [EMAIL PROTECTED]: I got asked how to do one particular thing in excel, which led to discssion with our local MSOffice expert. During the discussion I stated that's it too much of a PITA and that I'd rather write a script. Long story short, I promised him a one-liner to show

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Dougal Stanton
2008/9/30 wman [EMAIL PROTECTED]: I got asked how to do one particular thing in excel, which led to discssion with our local MSOffice expert. During the discussion I stated that's it too much of a PITA and that I'd rather write a script. Long story short, I promised him a one-liner to show

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Simon Brenner
Something like this perhaps: writeFile output.csv . printCSV . map updateLine . fromRight = parseCSVFromFile input.csv (with fromRight = either (error fromRight :: Left) id or something equivalent) On 9/30/08, wman [EMAIL PROTECTED] wrote: I got asked how to do one particular thing in excel,

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread wman
Thanks a lot, I've had a hunch it was possible to get rid of those those liftM's. I turned it into: (writeFile output.csv) . printCSV . (map updateLine) . (either (error Chyba pri cteni CSV.) id) = parseCSVFromFile input.csv and am sincerely hoping he will try to decypher it's meaning ;-))) On

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Graham Fawcett
2008/9/30 wman [EMAIL PROTECTED]: Thanks a lot, I've had a hunch it was possible to get rid of those those liftM's. I turned it into: (writeFile output.csv) . printCSV . (map updateLine) . (either (error Chyba pri cteni CSV.) id) = parseCSVFromFile input.csv and am sincerely hoping he will

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread wman
True, true. And i told myself no-one would notice ;-)) On Tue, Sep 30, 2008 at 9:51 PM, Graham Fawcett [EMAIL PROTECTED]wrote: 2008/9/30 wman [EMAIL PROTECTED]: Thanks a lot, I've had a hunch it was possible to get rid of those those liftM's. I turned it into: (writeFile output.csv) .

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Henning Thielemann
On Tue, 30 Sep 2008, wman wrote: Thanks a lot, I've had a hunch it was possible to get rid of those those liftM's. I turned it into: (writeFile output.csv) . printCSV . (map updateLine) . (either (error Chyba pri cteni CSV.) id) = parseCSVFromFile input.csv You may even remove parentheses

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Derek Elkins
On Tue, 2008-09-30 at 14:54 -0400, Graham Fawcett wrote: 2008/9/30 wman [EMAIL PROTECTED]: I got asked how to do one particular thing in excel, which led to discssion with our local MSOffice expert. During the discussion I stated that's it too much of a PITA and that I'd rather write a