2 ms·
> But there is any easier way. In Haskell just use a typeclass I understand your point. In fact, I mostly do what you say, because it is simple and usually suf
by valenterry 5y ago
> But there is any easier way. In Haskell just use a typeclass
I understand your point. In fact, I mostly do what you say, because it is simple and usually sufficient in most cases.
But it is important to understand that there is a difference. A minilanguage or an embedded DSL with free monads allows for custom transformations and it completely separates the interpretation from the description of the domain logic/actions.
With the approach(es) that you mention, that is not the case. You both describe and directly execute/interprete the logic in an intermingled way. That can be an advantage because it makes things easier (less abstraction) and more direct, but it can be a disadvantage if you have the need to interpret in different ways and have full separation between these two phases.