To read all comments associated with this story, please click here.
> Abundance of IO, just like in every other Haskell program. What's the
> point of pure functional programming, if I have to use IO at every other
> line?
There is no real justification for that. The IO monad just models imperative programming in a purely functional way. There is no advantage over other imperative languages that way, except that you can easily combine imperative and functional programming without a lot of trouble. My guess is that we will see progamming languages in the future that support both functional and imperative programming and make programming in both, as well as combinations, simple (Lisp is not what I mean here because it doesn't separate the two different concepts at all).
My experience is that a greal deal of a program can be done without IO. "every other line" is a bit of an exaggeration. I haven't looked at the code of Xmonad, but for a simple window manager I expect a lot of X communication code to be present, which of course uses IO a lot. You can expect the percentage of IO-using code to drop as soon as the data models of a program grow more complex (that is, if you go and re-build something like GNOME/KDE in Haskell).
Call me a dissenter, but I think if you need something like monads to abstract something simple that every program has to do (mutation), then your language model is conceptually flawed. In elegant theories, basic concepts fall out of the fundamental logic. They don't have to be wrapped up in order to be compatible with it.
But hey, I think LOOP is neat, clearly I have no taste...
>My guess is that we will see progamming languages in the future that support both functional and imperative programming and make programming in both, as well as combinations, simple.
Such language exist since a long time: Ocaml allows both style, and it's quite fast too.
While I don't like much Ocaml's syntax, its clone F# (on .Net) has a nice syntax.
Unfortunately while Ocaml has been around for quite some time, it didn't gather a lot of momentum..
There's Scala too which provide an interesting mix of OO and functional style, with a nice syntax (on top of the JVM so it has access to Java code).
I don't know if Scala's gathering developers mindshare or not..






Member since:
2006-03-20
Abundance of IO, just like in every other Haskell program. What's the point of pure functional programming, if I have to use IO at every other line?