<div dir="auto">We should add an Ord constraint to Enum and Bounded. The more constraints we add to Enum, the fewer instances we will have and the sooner my ultimate goal of removing it altogether will be achieved. Mwahahahaha!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 18, 2020, 10:41 AM Oleg Grenrus <<a href="mailto:oleg.grenrus@iki.fi">oleg.grenrus@iki.fi</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<p>Is it (a bug)?<br>
<br>
What about [minBound .. maxBound]. If you change `Bounded`, you
need to change `Enum` too.<br>
<br>
From
<a href="https://hackage.haskell.org/package/base-4.14.0.0/docs/GHC-Enum.html#t:Enum" target="_blank" rel="noreferrer">https://hackage.haskell.org/package/base-4.14.0.0/docs/GHC-Enum.html#t:Enum</a><br>
<br>
- The calls succ maxBound and pred minBound should result in a
runtime error.<br>
- enumFrom and enumFromThen should be defined with an implicit
bound</p>
<p>The `min` and `max` in `minBound/maxBound` are related to `succ`,
`pred`, not to `compare`. If you argue against, then we should add
`Ord` super-class to `Enum` (and `Bounded`).<br>
</p>
<p>- Oleg<br>
</p>
<div>On 18.9.2020 16.54, Carter Schonwald
wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">Def a bug! Plz at myself and the core libraries
handle for code review plz. </div>
<div dir="auto"><br>
</div>
<div dir="auto">This sounds kinda related to an MR that has
languished too long regarding the behavior of Down on Ord1,
which I think is related??? (I tried to arbitrate / layout
possible answers for the related issue in the associated mr, but
none of the clc members have engaged in the design space
challenge)</div>
<div><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Sep 18, 2020 at 7:44
AM David Beacham <<a href="mailto:mail@dbeacham.co.uk" target="_blank" rel="noreferrer">mail@dbeacham.co.uk</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>Hi all,</div>
<div><br>
</div>
<div>The current instance for `Bounded a => Bounded
(Down a)` derives the `minBound` and `maxBound` exactly
as they are for the underlying type `a` where I think
they should be flipped to respect the flipped ordering
of `Down a`?</div>
<div><br>
</div>
<div>I have a feeling this has been come up in some other
context/list before but I couldn't find a reference to
it when searching - so sorry if this is a duplicate.</div>
<div><br>
</div>
<div>I've got a corresponding MR here: <a href="https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4081" target="_blank" rel="noreferrer">https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4081</a></div>
<div><br>
</div>
<div>Thanks, David.<br>
</div>
</div>
<br>
<br>
_______________________________________________<br>
<br>
Libraries mailing list<br>
<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br>
</blockquote>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Libraries mailing list
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank" rel="noreferrer">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a>
</pre>
</blockquote>
</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>