Hi Sebastian. As a writer of one of those "academic" Haskell
textbooks, I've been following this thread with some interest. In
fact, I agree with pretty much everything that's been said. But I must
point out that, even though Chapter 18 in SOE is titled "Higher Order
Types", and that's where I introduce the Monad class, I actually
introduce IO in Chapter 3 -- page 36 in a 363 page textbook to be more
precise. In fact, I do exactly as you suggest -- introduce IO early in
a way that most imperative programmers are familiar with, and then
expose the beauty and generality of monads much later -- i.e. in
Chapter 18. I don't know if you were referring to SOE when you said Chapter 18, but I thought that I should point out the coincidence, at least, if that's what it is! :-) While I'm at it, I have a couple of other general comments: I purposely wrote SOE in a style that I was hoping would be different from the standard language textbook, namely I tried to introduce language features as they were needed in solving problems, rather than just rattling off a list of language features. Granted, my toy "multimedia" examples are not well motivated by the real world, so it doesn't necessarily apply to what's now being proposed. But I wanted to point out that this was nevertheless really hard to do, and the sequencing of the material was a real challenge -- I'm not even sure that I would follow this formula again if I rewrote the book. Maybe some of you can do better, but it's really tough to show someone how an advanced Haskell programmer would solve advanced problems that arise in the real world. As a simple example, I love this recent quote by Garrett Morris: "I'm personally fond of framing most non-trivial Haskell problems as defining domain specific languages; as a result, everything over about 200 lines that I've written in the past 3 years has used the mtl [Monad Transformer Library] in some form or fashion. It's great." So how do we teach Garrett's way of programming (which I like very much) to the masses? One would guess that we'd need to explain not only monads, but also monad transformers, first. One of the things I found myself doing in SOE is saying things like, "remember that thing we did way back in Chapter 3? Using monads, we can now express it more elegantly and modularly and succinctly like this: ..." But there is danger in doing this. If we teach newbies how to do things the "beginner's" way first (recursion instead of higher-order functions, lists instead of user-defined data types, specialized functions instead of type classes, and so on), then we risk the user saying "Oh this is just typed Lisp, so I'm outa here." So, I am *all for* someone writing a textbook that tackles real, meaty problems from the real world. But it's not at all clear to me how to do it. There seems to be a need for a fine balance between elementary stuff and advanced stuff, mixed with both elementary and advanced applications. I hope that some of you are up for the challenge! -Paul Hudak Sebastian Sylvan wrote: On 12/11/06, Kirsten Chevalier <[EMAIL PROTECTED]> wrote: -- Professor Paul Hudak Department of Computer Science Office: (203) 432-1235 Yale University FAX: (203) 432-0593 P.O. Box 208285 email: [EMAIL PROTECTED] New Haven, CT 06520-8285 WWW: www.cs.yale.edu/~hudak |
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe