Reputation: 837
Eff monad
looks so much better and more usable than monad transformers and can replace boilerplates with monad transformation, but Free monad
can make the exact same thing with providing division between execution and program definition, as consequence Eff monad
looks like overhead. If I missed some nuance, please correct me.
Upvotes: 3
Views: 711
Reputation: 7768
Monad transformers is what you want to use for you every day programs, it let's you map
and flatMap
on T
in Task[Option[T]]
, for example.
Free
and Eff
solve a different problem: they let you write multiple interpreters for your programs (which is most likely overkill for your everyday application). They are both used to build monadic expressions. Eff
lets you "split the labor" of interpretation into multiple interpreters, while with Free
you typically transform expression "all at once" from their Free
structure to another monad.
Upvotes: 4