[Haskell-cafe] Haskell-Cafe Digest, Vol 174, Issue 9

Doug McIlroy doug at cs.dartmouth.edu
Thu Feb 8 14:47:54 UTC 2018


Thanks for the quidk reply. Please do send info about local
arrangements. All I know is the dates.

I read your shell assignment (but haven't yet looked at your
program). It's a very good model of real life with Unix, particularly
in regard to data laundry: automate what you can, but check the
results. And that often feeds back into insight about further
automation. I was once doing just such a  job (in this case, trying
to devise pronunciation rules for a text-to-speech system) when I
got tired of using an editor to scan a dictionary that was too
big to fit. I asked Ken Thompson if he could extract the editor's
regular-expression recognizer into a free standing program. It
turned out he had already done so for his own private use. Thus
did grep make its appearance among Unix tools.

Incidentally, you suggest using sed to get rid of carriage
returns, disguised as ^M--very confusing because as a regular
expression ^M means an M at the beginning of a line. The
simplest solution I know is tr -d '\r'.

For another revealing shell exercise you may like
http://www.cs.dartmouth.edu/~doug/sieve.pdf. The shell
stuff begins on page 4. Then comes truly lovely code
in Haskell.

Doug


More information about the Haskell-Cafe mailing list