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

Henning Thielemann lemming at henning-thielemann.de
Mon Dec 10 14:00:41 EST 2007


On Mon, 10 Dec 2007, Dan Piponi wrote:

> When someone comes to me and says "I have this Python script that
> scans through these directories and finds the files that meet these
> criteria and generates a report based on this template, could I do it
> better in Haskell?" it'd be good to have a better answer than "to do
> this you could use the IO monad, but to do things properly you need to
> understand monads so here, learn about the List monad and the Maybe
> monad first, understand how this interface abstracts from both, come
> back when you've finished that, and then I'll tell you how to read and
> write files". And I definitely want a better answer than "Haskell I/O
> is performed using the IO monad but everyone thinks this is bad so
> just wait a few years and someone may write a fancy new nice
> combinator library that does exactly what you want". There are
> thousands of competing programming languages out there, and there are
> dozens that are viable choices for the task I just mentioned. If my
> response to their question takes longer than the time it would take to
> find another language and implement a solution, then Haskell will
> remain a niche language.

I raise my question once again: Must Haskell's tutorials be tailored to
impatient programmers? Does Haskell need quick&dirty hackers?


More information about the Haskell-Cafe mailing list