
Creighton Hogg wrote:
On Wed, 21 Dec 2005, Henning Thielemann wrote:
The drawback is that I saw many Haskell programs implemented with IO read/write functions which could be easily implemented without IO, using laziness.
Can you think of any examples of things like that? Given that I'm still learning how to take advantage of laziness it'd be pretty interesting.
Here's another one: I've heard a fellow claim, Haskell is basically unsuitable to implement a compiler, because Haskell is weak at IO and "everything needs IO, the lexer, the preprocessor, the parser, the pretty-printer, ..." Can you imagine what convoluted mess he would write if he learned IO first? Therefore I think, if, say, chapter 6 includes "A parser for Things is a function from Strings to a list of Things and Strings", then chapter 7 is the earliest that should include IO beyond getContents and putStr. The funny thing is, after the parser IO is simply another monad. At this point, the compiler becomes an imperative one-liner and lots of pure functions. Udo. -- I piss on you all from a considerable height. -- Louis Ferdinand Celine