<div dir="ltr">Clever. I'm surprised those instances weren't already there.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 7, 2018 at 11:19 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">We can write<div dir="auto"><br></div><div dir="auto">instance Bounded a => Bounded (Maybe a) where</div><div dir="auto"> minBound = Nothing</div><div dir="auto"> maxBound = Just maxBound</div><div dir="auto"><br></div><div dir="auto"><div dir="auto" style="font-family:sans-serif">instance (Bounded a, Bounded b) => Bounded (Either a b) where</div><div dir="auto" style="font-family:sans-serif"> minBound = Left minBound</div><div dir="auto" style="font-family:sans-serif"> maxBound = Right maxBound</div><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto" style="font-family:sans-serif">While Bounded intentionally does not have an Ord superclass, I think it's worth mentioning that these are the instances that arise naturally from the Ord instances for the types in question.</div></div></div>
<br>______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>