[Haskell-cafe] csv one-liner

wman 666wman at gmail.com
Wed Oct 1 16:23:00 EDT 2008


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 without the abundant
liftM's), the beauty of it lies in figuring how the heck it does what it
does. And figuring that out should bring the "profound enlightenment
experience; that experience which should make you a better programmer for
the rest of your days, even if you never actually use Lisp -erm Haskell-
itself a lot" (my apologies, P. Graham, for cannibalizing your words).

I should probably get myself a signature stating that i will explicitly warn
the reader when being serious ;-)

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.

On Wed, Oct 1, 2008 at 9:51 PM, Andrew Coppin
<andrewcoppin at btinternet.com>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 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 that the combined mindpower of the
> entire mailing list can produce?
>
> Yes, there is much to be said for the power and brevity of Haskell. But you
> *can* go over the top here, people! o_O
>
> Keep it short _yet comprehensible_, IMHO.
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081001/d38d169e/attachment.htm


More information about the Haskell-Cafe mailing list