Monoid Instance for ReaderT

Andrew Martin andrew.thaddeus at gmail.com
Tue Nov 28 23:28:47 UTC 2017


Ah, I had forgotten about that one. Yeah, I wish it did Cartesian product too. Although somehow, I never actually find myself using the Monoid instance for list at all. But, changing the Monoid instance for list is not a battle I want to fight, now or ever. The breakage, both of code and of tutorials that talk about the free Monoid, would just be enormous. I’ve decided instead to focus on improving the Monoid instance for Map, which I think could actually be done without as much trouble. But anyway, that’s a topic for another thread.

Sent from my iPhone

> On Nov 28, 2017, at 5:18 PM, M Farkas-Dyck <m.farkasdyck at gmail.com> wrote:
> 
>> On 28/11/2017, Andrew Martin <andrew.thaddeus at gmail.com> wrote:
>> This is also how the Monoid instance of basically everything with an
>> Applicative instance is defined. The only one that I feel should differ
>> from the others is Maybe, and that's getting fixed when Semigroup becomes a
>> superclass of Monoid.
> 
> I also feel the `[]` instance ought to do the Cartesian product. (To
> recover the free monoid one would write `Alt []` rather than `[]`
> which is fine by me.)


More information about the Libraries mailing list