Indeed. Enum as it’s currently defined is totally broken and actively a bad interface :)

On Fri, Sep 18, 2020 at 11:04 AM David Feuer <david.feuer@gmail.com> wrote:
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!

On Fri, Sep 18, 2020, 10:41 AM Oleg Grenrus <oleg.grenrus@iki.fi> wrote:










Is it (a bug)?





What about [minBound .. maxBound]. If you change `Bounded`, you

need to change `Enum` too.





From

https://hackage.haskell.org/package/base-4.14.0.0/docs/GHC-Enum.html#t:Enum





- The calls succ maxBound and pred minBound should result in a

runtime error.


- enumFrom and enumFromThen should be defined with an implicit

bound



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`).




- Oleg




On 18.9.2020 16.54, Carter Schonwald

wrote:








Def a bug! Plz at myself and the core libraries

handle for code review plz. 







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)







On Fri, Sep 18, 2020 at 7:44

AM David Beacham <mail@dbeacham.co.uk> wrote:








Hi all,







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`?







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.














Thanks, David.












_______________________________________________





Libraries mailing list





Libraries@haskell.org





http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
















_______________________________________________

Libraries mailing list

Libraries@haskell.org

http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries









_______________________________________________


Libraries mailing list


Libraries@haskell.org


http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries




_______________________________________________

Libraries mailing list

Libraries@haskell.org

http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries