[Haskell-cafe] MTL vs Free-monads, what are your experiences

Julian hasufell at hasufell.de
Thu Oct 20 16:39:00 UTC 2016

Damian Nadales:
> I was thinking, besides the evaluation of performance, the simplicity
> of the approach is also important ("developer time is more expensive
> than CPU time" anyone?). Note that I said simple and not easy ;)
> I guess this aspect is a rather subjective one, but maybe there are
> elements that can be intuitively quantified. Right now I'm playing
> with free monads and MTL, to have an idea which one seems simpler to
> me.

I care about simplicity too, but my interpretation might be slightly
different. I also focus more on the things that a "normal" programmer
cares about without going into esoteric use cases and technical properties.

What I want wrt effects in haskell is:
1. easy to construct (MTL is built on top of transformers, so you get
the same rat-tail there)
2. dynamic: most, of the time I don't care about the ordering of effect
3. no liftXY boilerplate code (freer [0] can do that to some extent with
type inference)
4. being able to add and remove effects without it screwing too much
with my internal API

Basically, it must be declarative, intuitive and non-intrusive.

For some reason, I lean more towards freer/EE here. But it's more like
hope. We tried to make more complicated use of IO subtyping with freer
and it turned out to be rather complicated [1].

Also, afair, edwardk wasn't particularly overwhelmed by the new EE
approach [2].

[0] https://hackage.haskell.org/package/freer
[1] https://gitlab.com/queertypes/freer/issues/7

More information about the Haskell-Cafe mailing list