
Am 01.02.2015 um 23:02 schrieb Edward Kmett:
On Sun, Feb 1, 2015 at 4:39 PM, Iavor Diatchki
mailto:iavor.diatchki@gmail.com> wrote: Really? This is not obvious at all. Is it because of the odd `Applicative` instance for pairs? I am saying 'odd' because there are no similar instances for tuples of higher arity; there are also no instance for `Monad` for the same type, which makes as much sense, I guess. Obviously this is just an opinion, but I don't think these instances fit pairs naturally, and make for confusing looking code.
instance Monoid m => Monad ((,) m)
is the "unnamed" writer monad that corresponds to the
That looks like a hack which requires another hack (namely moving Monoid to Prelude). Would it have been too difficult to use the Writer monad from transformers or mtl? Btw. I think if I use this instance this is certainly by accident. I prefer to be explicit about my programming intentions and would use the Writer monad.