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

Christopher Allen cma at bitemyapp.com
Wed Oct 19 17:26:04 UTC 2016


It's not really more direct. It's an unordered collection of effects
you can use. IME it's a less efficient mtl-style, but YMMV.

Taking an example from a PureScript tutorial:

func :: Eff (console :: CONSOLE, random :: RANDOM) Unit

Can just as easily be:

func :: (MonadConsole m, MonadGimmeRandom m) => m ()

(mangled name so it doesn't overlap with a real class)

There are other differences, but they haven't amounted to much for me yet.

Kmett's Quine has a good example of some homespun mtl-style:
https://github.com/ekmett/quine

On Wed, Oct 19, 2016 at 12:17 PM, Will Yager <will.yager at gmail.com> wrote:
> Can anyone comment on the use of Purescript-style effect monads as compared to MTL and Free? While I have not used them in practice, they seem to express the "intent" of monad composition a bit more directly than the approaches we use in Haskell.
>
> Cheers,
> Will
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



-- 
Chris Allen
Currently working on http://haskellbook.com


More information about the Haskell-Cafe mailing list