There is a law obeyed by newsgroups, which seems to be
respected here: the most trivial problem, when presented in
a provocative sauce focuses the attention of so many people,
that the issue becomes disturbing.


Lars Lundgren continues to save the soul of Friedrich Dominicus:


FD> I disagree, small scripts spend most of the time doing I/O if I
don't
> > understand how to do that I'm not able to even write the most simple
> > things. This is eg. true for my cat ...
> 
> If you just want to read stdin and write to stdout - use interact, if you
> whant to read a file - use readFile, if you want to write to a file - use
> writeFile. What is the problem? I think you are making it harder than it
> is.
> 
> /Lars L


I don't want to be just acrimonious, but I would say: if you just
want a "cat", use a "cat" in any imperative language, and don't waste
your time on Haskell. 90% of my functional programs were <<small
scripts>>
in Haskell, CAML, Scheme, etc. and I find the statement that such
programs spend most of time "doing IO", completely misplaced. It is true
that the system layer of the program (or of the interpreter) uses most
of the execution time, but this is completely irrelevant for the sense
of the program. Using the interpreter main loop is easier than launching
"interact". But first, pose the question: what do you *really* need?,
because otherwise the problem reduces to the following:

   "Yes, these knives you want to sell me are very nice. Sharp,
    but comfortable to handle, not expensive, and easy to clean.
    But, you see, I spend *MOST* of my time in the kitchen opening
    bottles and drinking water. So, if your knife can't help me to
    drink water more efficiently, go away, and take your knife with 
    you".

More seriously, I jumped into this FP paradise from a good, Fortran
loving milieu, when I found that there were problems very awkward to
solve using imperative programming. I wouldn't have started to use FP
just to test that it is possible to repeat the standard imperative
archetypic codes functionally, because it is not very rewarding.

Sorry for bothering you with my pseudopedagoguerese.

Jerzy Karczmarczuk
Caen, France.


Reply via email to