[Haskell-cafe] Haskell-Cafe Digest, Vol 93, Issue 58
M.C.A. (Marco) Devillers
marco.devillers at gmail.com
Fri Jun 10 01:54:04 CEST 2011
> I think there is a tendency to look at IO as bad because pure code is so
> much better. But it's important to keep things in perspective - the
> existence of something better doesn't make something bad. IO is still
> better than the best of most other languages.
I have been bashing IO from time to time on lambda-the-ultimate.org (LtU). I
can't say I got a lot of response, so I don't think there's a lot of hate
The thing about IO is that it solves one problem well: interfacing with an
imperative sequential world. Old manners like stream handling functions are
just plain awkward and need some kind rendezvous; uniqueness typing is fast,
composable, but a bit awkward too, and -truth be told- better encapsulated
in its own monad probably anyway.
There also is certainly a case that banning benign side effects might have a
lot more to do with the fact that that is inherently difficult in a lazy
pure language (and compiler for that) than that it's so bad for the average
The thing against the IO monad is not that there's anything wrong with it.
Just that it kind of locks programmers into a style of programming, I
believe, functional programming is just trying to avoid, i.e., imperative
The whole point of old-school functional programming was (always) to
declaratively build libraries out of combinators which implement a specific
purpose. Now, I don't know Haskell that well, but it feels to me that a lot
of libraries written are now in a sequential imperative style instead of
that combinatorial style.
So, I, for one, are not against IO, but consider it something which should
be avoided instead of cuddled.
(Sorry for sending multiple copies James; the woes of gmail... sigh...)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe