[Haskell-cafe] Re: Monads aren't evil? I think they are.

Henning Thielemann schlepptop at henning-thielemann.de
Mon Jan 12 15:28:48 EST 2009


Ertugrul Soeylemez schrieb:
> "Apfelmus, Heinrich" <apfelmus at quantentunnel.de> wrote:
> 
>> The insistence on avoiding monads by experienced Haskellers, in
>> particular on avoiding the IO monad, is motivated by the quest for
>> elegance.
>>
>> The IO and other monads make it easy to fall back to imperative
>> programming patterns to "get the job done".  [...]
> 
> Often, the monadic solution _is_ the elegant solution.  Please don't
> confuse monads with impure operations.  I use the monadic properties of
> lists, often together with monad transformers, to find elegant
> solutions.  As long as you're not abusing monads to program
> imperatively, I think, they are an excellent and elegant structure.

I have seen several libraries where all functions of a monad have the
monadic result (), e.g. Binary.Put and other writing functions. This is
a clear indicator, that the Monad instance is artificial and was only
chosen because of the 'do' notation.



More information about the Haskell-Cafe mailing list