[Haskell-cafe] Re: Is my code too complicated?

Stephen Tetley stephen.tetley at gmail.com
Mon Jul 5 09:27:24 EDT 2010


On 5 July 2010 11:30, Ertugrul Soeylemez <es at ertes.de> wrote:

> That's what monad transformers are good for.  Why reinvent the wheel?

Hi Ertugrul

The post was chiming in with Felipe Lessa's comment upthread that
avoiding transfomers can have performance benefits.

Whether the formulation I gave is particulary efficient is moot - I'd
have to give consideration to the strictness of the state at least -
but I was answering Yves Parès about "how" you would do it, rather
than "why".

Given the status of MTL, I nowadays avoid transformers for pragmatic
reasons rather than performance ones. If I have substantial code I'll
rely on Iavor S. Diatchki's very nice MonadLib, but for small projects
I'll just roll an amalgamated monad.


More information about the Haskell-Cafe mailing list