Re: Monoid for ZipList

박신환 ndospark320 at
Thu May 3 23:40:44 UTC 2018

I aim to make the semantic consistent compared to that of other type classes (here Maybe).
Also note that your instance is identical to upcoming Ap, as Ap (ZipList a). I also aim to make Monoids as diverse as possible. 
-----Original Message-----
From: "Andrew Martin"<andrew.thaddeus at>
To: "박신환"<ndospark320 at>;
Cc: "Haskell Libraries"<libraries at>;
Sent: 2018-05-03 (목) 21:05:24
Subject: Re: Monoid for ZipList
There is another possible instance. We can instead write:
    instance Semigroup a => Semigroup (ZipList a) where
      (<>) = liftA2 (<>)
    instance Monoid a => Monoid (ZipList a) where
      mempty = pure mempty
This behaves differently, and it is also law-abiding.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list