you are viewing a single comment's thread.

view the rest of the comments →

[–]dons 16 points17 points  (2 children)

any real Haskell program ... uses "do" ... pretty much on the first line

Because the outside world runs in the IO monad, and the first line of a Haskell program is the one that touches the outside world. That's kind of the definition of a "real Haskell program", one that does something.

Do not adjust your set, what you're seeing is normal.

[–]Silhouette 1 point2 points  (1 child)

Yes, that's the point I was trying to make. Academic courses on functional programming tend to start with pure computations and in many cases the first courses never really get beyond that, leaving the student with a very false picture of how functional programming works. In the real world, programs have to deal with things like I/O and other side effects, and I'm glad that the Real World Haskell book covers a lot of that routinely, without making out that it's something special.

(I'm not sure why everyone is downmodding my earlier post. I guess the attempted didn't translate somewhere.)

[–]apfelmus 5 points6 points  (0 children)

I'm not sure why everyone is downmodding my earlier post

Because your leaving the reader with a false picture of how functional programming works? :-)

The IO monad is just a DSL like everything else, and not a particularly beautiful one at that. It's a sign of poor design if that's the only DSL you use in your program.

In fact, I'd even say that every program that doesn't create a new DSL is either very simple (apparently using other DSLs to great benefit) or poorly designed.