<div dir="auto">Which raises the question, why is there not an Enumerate class with Integer in place of Int? It would agree better with Integral.</div><div class="gmail_extra"><br><div class="gmail_quote">On Jun 2, 2018 07:15, "Andrew Martin" <<a href="mailto:andrew.thaddeus@gmail.com">andrew.thaddeus@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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? <br>
<br>
Sent from my iPhone<div class="elided-text"><br>
<br>
> On Jun 2, 2018, at 1:39 AM, Tom Ellis <<a href="mailto:tom-lists-haskell-cafe-2013@jaguarpaw.co.uk" target="_blank" rel="noreferrer">tom-lists-haskell-cafe-2013@jaguarpaw.co.uk</a>> wrote:<br>
> <br>
>> On Fri, Jun 01, 2018 at 10:21:45PM +0200, MarLinn wrote:<br>
>> <br>
>>> Sorry, could you explain further?  I don't understand what the<br>
>>> implementation of any of those proposed instances is supposed to be.<br>
>> <br>
>> Sure.<br>
> [...]<br>
>> Hope it's clearer now what I meant.<br>
> <br>
> It's clearer what you meant, but I always assumed that fromEnum and toEnum<br>
> must be mutually inverse.  I can't see that law written anywhere in the docs<br>
> but it seems to be an almost useless class without that assumption.  The<br>
> default implementations of the other methods seems to be completely based on<br>
> that assumption, for example:<br>
> <br>
>    <a href="http://hackage.haskell.org/package/base-4.11.1.0/docs/src/GHC.Enum.html#Enum" rel="noreferrer noreferrer" target="_blank">http://hackage.haskell.org/package/base-4.11.1.0/docs/src/GHC.Enum.html#Enum</a><br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> To (un)subscribe, modify options or view archives go to:<br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> Only members subscribed via the mailman list are allowed to post.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</div></blockquote></div><br></div>