Add 'e' to Floating typeclass

Yitzchak Gale gale at sefer.org
Sun Feb 17 19:34:07 UTC 2019


Shaddowing of 'e' is not a reason not to do this - it's only a reason
not to call it 'e'. There has never been a shortage of bikeshedding
skills in this community. I'm sure we could come up with something if
we decide to do it. At least as good as things like
"GHC.Float.log1mexp" that have already been added to this typeclass.

I think Carter's remarks about exp 1 are more to the point. Can we
assume that every implentation special cases exp 1, or is computing
exp 1 once and sharing it really satisfactory? And if so - then what's
so much worse about 2 * asin 1?

On Sun, Feb 17, 2019 at 5:41 PM Carter Schonwald
<carter.schonwald at gmail.com> wrote:
>
> I meant shaddowing warning.  As Brent more correctly said.
>
> On Sun, Feb 17, 2019 at 10:39 AM Carter Schonwald <carter.schonwald at gmail.com> wrote:
>>
>> There’s at least  two reasons why I think this would be a bad idea
>>
>> 1) everyone uses e as a local variable name, or at least it happens often enough. This would breaklots of code
>>
>> 2 ) I’m not sure if there’s ever a better definition than exp 1.  Is there?
>>
>> 3) more strongly , does every instance in the Wild give a full ish precision exact up to representation limits answer at exp 1,?
>>
>> I only thought of the name space issue after I stated writing this email , but I think that kills it.. but I am genuinely curious : can we treat exp 1 as being the actual definition for any all quality instances ?
>>
>> On Sun, Feb 17, 2019 at 12:14 AM chessai . <chessai1996 at gmail.com> wrote:
>>>
>>> We have the 'pi' constant in the floating typeclass and some trigonometric functions, as well as things like exp/log/expm1/log1p.
>>>
>>> Why not provide an 'e' constant?
>>>
>>> A default implementation could just be 'exp 1'.
>>> _______________________________________________
>>> Libraries mailing list
>>> Libraries at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


More information about the Libraries mailing list