Deprecating fromIntegral

Sakumatti Luukkonen sakumatti.luukkonen at gmail.com
Mon Aug 10 09:06:16 UTC 2020


I imagine that STAN (https://github.com/kowainik/stan) should be able to
detect dangerous uses of fromIntegral even without visible type
applications.

But perhaps GHC could simply issue a warning in such cases?

ma 10.8.2020 klo 11.45 David Feuer <david.feuer at gmail.com> kirjoitti:

> I wonder if this is something HLint could help with. I imagine many bugs
> could be avoided if every use of fromIntegral used visible type application
> to indicate explicitly what type was being converted to what type.
>
> On Mon, Aug 10, 2020, 4:34 AM Sven Panne <svenpanne at gmail.com> wrote:
>
>> Am Mo., 10. Aug. 2020 um 09:15 Uhr schrieb Bardur Arantsson <
>> spam at scientician.net>:
>>
>>> On 08/08/2020 15.44, Vanessa McHale wrote:
>>> > -1 from me, massive work to overhaul the ecosystem.
>>>
>>> Why would a massive overhaul be necessary for deprecation? If that's the
>>> case then there's a deeper more serious underlying issue around
>>> deprecation, IMO.
>>>
>>
>> Two things come to my mind here:
>>
>>    * You'll probably break quite a few projects which use -Werror. I know
>> that there are different opinions regarding -Werror in general, but in any
>> case there *will* be breakage.
>>
>>    * If you consider books and tutorials a part of the ecosystem (which I
>> definitely do), there is even more "breakage": From the top of my head I
>> would say that quite a few of them use fromIntegral, so deprecation will
>> cause confusion.
>>
>> All these things are definitely fixable, but neither quickly nor without
>> a negligible cost. Deprecations should not be done lightly.
>>
>> Regarding the deprecation itself: I fail to see why fromIntegral is worse
>> than (+), (-), (*), ..., and nobody is proposing to remove these. The real
>> problem is using fixed-sized numbers where they shouldn't be used, so a -1
>> from me.
>>
>> Cheers,
>>    S.
>>
>> _______________________________________________
>> 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
>
-- 
Sakumatti Luukkonen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20200810/b76b0bd0/attachment.html>


More information about the Libraries mailing list