Craig Dickson wrote:
> Jeff Dalton <[EMAIL PROTECTED]> wrote:
>
> > Sure, cat in itself isn't very interesting. But cat is just a simple
> > case of a more interesting problem, that of writing what Unix calls
> > "filters": programs that take some input from a file or pipe or other
> > similar source and transform it into some output.
>
> Yes, but cat *doesn't* transform anything. The problem is not that cat is a
> filter, but that it is such a trivial one.
No kidding. But if you actually want to process the contents of files
(and similar sources), cat is a fine starting point. If someone wanted
to write grep (an example Craig gave), they might well start with
something that was essentially just cat.
Moreover, just doing the I/O is somewhat interesting in itself,
because it's not at all obvious to someone just starting to learn
about functional programming how to do it in a functional way.
-- jd