25 Mar
2026
25 Mar
'26
10:47 p.m.
On Wed, Mar 25, 2026 at 11:56:21PM +1100, Viktor Dukhovni wrote:
On Wed, Mar 25, 2026 at 10:23:37AM +0000, Tom Ellis wrote:
On Wed, Mar 25, 2026 at 11:19:20AM +0100, Olaf Klinke via Haskell-Cafe wrote:
For (Bounded a, Ord a) one should replace maximum by an ordinary fold, given a suitable newtype wrapper with a Monoid instance, e.g.
(Ord a, Bounded a) => Monoid (Data.Semigroup.Max a)
For a Semigroup surely it doesn't need Bounded? (A Monoid would need Bounded).
What Olaf seems to have in mind does neet a Monoid, for example:
Yes, I misunderstood the type `Data.Semigroup.Max` (which just happens to live in `Data.Semigroup`) for the `Semigroup` class. I missed that the class is actually `Monoid`. Tom