Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-09 Thread Conal Elliott
IO is important because you can't write any real program without using it. Ouch! I get awfully discouraged when I read statements like this one. The more people who believe it, the more true it becomes. If you want to do functional programming, instead of imperative programming in a

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-09 Thread Daniel Fischer
Am Sonntag, 9. Dezember 2007 18:31 schrieb Conal Elliott: IO is important because you can't write any real program without using it. Ouch! I get awfully discouraged when I read statements like this one. The more people who believe it, the more true it becomes. If you want to do

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-09 Thread Lennart Augustsson
Conal, It's true that you can avoid using IO (except for a wrapper) for certain kinds of programs. For instance, if all you want is a String-String function, or some GUI program (you forgot to mention fudgets, which was the first wrapper of this kind) then you can ignore IO and just use a nice

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-09 Thread Conal Elliott
Thanks. If I'm tracking, your real point is that imperative programming in Haskell is still useful enough to keep around. I agree. I'm still puzzled. Did you understand something I said, or maybe someone else said, as suggesting that imperative programming be removed from Haskell any time

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-09 Thread Lennart Augustsson
I doubt all imperative programming will be banished from Haskell anytime soon. I really, really wish we had all the nice abstractions in place already, but we just don't. You can't write any program in Haskell without using IO, because the type of main involves IO. And currently I believe that

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-09 Thread Conal Elliott
It so happens that Haskell currently insists on main :: IO (). That's simple to fix, however, and with great pay-off. Suppose instead main :: TV a (where I'm omitting the other TV type args for simplicity.) Then a program could not only be run, but also composed with other programs. They could

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-08 Thread Lennart Augustsson
I agree with Dan here. IO is important because you can't write any real program without using it. So why not teach enough of it to get people off the ground straight away? People who hang around long enough to do some more Haskell programming will run into the other monads sooner or later. But

[Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-03 Thread Ben Franksen
Dan Piponi wrote: On Dec 3, 2007 3:54 PM, Ben Franksen [EMAIL PROTECTED] wrote: I don't buy this. As has been noted by others before, IO is a very special case, in that it can't be defined in Haskell itself, and there is no evaluation function runIO :: IO a - a. I'm not sure what a

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-03 Thread Dan Piponi
On Dec 3, 2007 6:36 PM, Ben Franksen [EMAIL PROTECTED] wrote: then the special features of IO will remain associated with monads in general, leading to a whole jumble of completely wrong ideas about them. As I only learnt about monads a couple of years ago, the process is still fresh in my