<p>
I&#39;d like to add two instances to <tt>Data.Monoid</tt>, alongside of All/Any, Sum/Product, and First/Last.
</p>
<p>
Here&#39;s a current instance (as a style example):
</p>
<pre style="margin-left: 40px;" class="wiki">-- | Boolean monoid under conjunction.<br>newtype All = All { getAll :: Bool }<br>        deriving (Eq, Ord, Read, Show, Bounded)<br><br>instance Monoid All where<br>        mempty = All True
<br>        All x `mappend` All y = All (x &amp;&amp; y)<br></pre><p>
My proposed addition:
</p>
<pre style="margin-left: 40px;" class="wiki">-- | Ordered monoid under &#39;max&#39;.<br>newtype Max a = Max { getMax :: a }<br>        deriving (Eq, Ord, Read, Show, Bounded)<br><br>instance (Ord a, Bounded a) =&gt; Monoid (Max a) where
<br>        mempty = Max minBound<br>        Max a `mappend` Max b = Max (a `max` b)<br><br>-- | Ordered monoid under &#39;min&#39;.<br>newtype Min a = Min { getMin :: a }<br>        deriving (Eq, Ord, Read, Show, Bounded)<br><br>instance (Ord a, Bounded a) =&gt; Monoid (Min a) where
<br>        mempty = Min minBound<br>        Min a `mappend` Min b = Min (a `min` b)<br></pre><br>I have a niggling uncertainty about the Ord &amp; Bounded instances for Min a? Is there a reason flip the a ordering instead of preserving it?
<br><br>Suggested review period: two weeks (ending December 16).<br><br>Comments?<br><br>&nbsp; - Conal<br>