<div><div dir="auto">I’m -10 in this proposal </div><div dir="auto"><br></div><div dir="auto">Every time I write a number literal I’ll now get a warning.  Cause as it hasn’t been remarked : every integer literal uses these operations afaik</div><div dir="auto"><br></div><div dir="auto">The intent / spirit of this proposal is correct, the method of recourse isn’t.  </div><br><div class="gmail_quote"><div>On Thu, Sep 21, 2017 at 7:20 PM Niklas Hambüchen <<a href="mailto:mail@nh2.me">mail@nh2.me</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 21/09/17 19:27, Evan Laforge wrote:<br>
> If I were to suddenly get 10,000 lines of warnings...<br>
<br>
If the built tool is set up sensibly (perhaps we should make it so if<br>
that is not already possible, but I think these days warnings of<br>
dependency packages are omitted anyway, as cabal and stack build them in<br>
parallel), you should get (and care about and fix) only warnings about<br>
those occurrences that are in the packages you maintain / build directly.<br>
<br>
You are unlikely to get 10,000 warnings:<br>
<br>
I've made a quick histogram over all of Hackage (note, this includes<br>
lots of abanoned code)<br>
<br>
<br>
<a href="https://gist.github.com/nh2/f45d628a81c04f95e14f14ea37d33b22#file-fromintegral-uses-png" rel="noreferrer" target="_blank">https://gist.github.com/nh2/f45d628a81c04f95e14f14ea37d33b22#file-fromintegral-uses-png</a><br>
<br>
There is also a JSON file containing counts for each packet so that you<br>
can quickly look up how many occurrences your packages have.<br>
<br>
Most packages have < 3 occurrences of fromIntegral, a few have < 20<br>
occurrences. Very few have more than 20.<br>
<br>
Assuming we go for a naming improvement and add 3 functions ala<br>
maybeFromInteger / runtimeCheckedFromInteger / fromIntegerWrap, a<br>
package owner would have to step through their deprecation warnings and<br>
replace each with one of the new 3 functions to get their package<br>
warning-free.<br>
<br>
I estimate this to be a very minor task/effort compared to the major<br>
changes GHC Haskell has gone through in the last years.<br>
<br>
I could probably already have fixed 1000 of the 7000 total occurrences<br>
on Hackage myself within the time it as taken me to debug integer<br>
conversion related problems in GHC/base in the last week.<br>
<br>
(In other words, these changes are cheap and have high payoff.)<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>