[Haskell-cafe] No Enum for (,), no Enum or Bounded for Either

Ryan Reich ryan.reich at gmail.com
Sat Jun 2 16:34:38 UTC 2018


Which raises the question, why is there not an Enumerate class with Integer
in place of Int? It would agree better with Integral.

On Jun 2, 2018 07:15, "Andrew Martin" <andrew.thaddeus at gmail.com> wrote:

The way I understand it is more like: they should be Mutual inverses if the
type has fewer inhabitants than Int does, and otherwise, just kind of do
the best you can. What about the instance for Integer?

Sent from my iPhone


> On Jun 2, 2018, at 1:39 AM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
>
>> On Fri, Jun 01, 2018 at 10:21:45PM +0200, MarLinn wrote:
>>
>>> Sorry, could you explain further?  I don't understand what the
>>> implementation of any of those proposed instances is supposed to be.
>>
>> Sure.
> [...]
>> Hope it's clearer now what I meant.
>
> It's clearer what you meant, but I always assumed that fromEnum and toEnum
> must be mutually inverse.  I can't see that law written anywhere in the
docs
> but it seems to be an almost useless class without that assumption.  The
> default implementations of the other methods seems to be completely based
on
> that assumption, for example:
>
>
http://hackage.haskell.org/package/base-4.11.1.0/docs/src/GHC.Enum.html#Enum
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180602/9ad4bff3/attachment.html>


More information about the Haskell-Cafe mailing list