Deprecating fromIntegral
Niklas Hambüchen
mail at nh2.me
Thu Sep 21 15:57:06 UTC 2017
Hey Herbert,
> I ran into this very problem early on. I'll use the opportunity to
> shamelessly plug an older package of mine probably only few know about
> which solved this very problem in mission critical systems for me while
> avoiding to have to enumerate O(n^2) transitions explicitly:
>
>
http://hackage.haskell.org/package/int-cast-0.1.2.0/docs/Data-IntCast.html
This is very useful, thanks for that.
> Tbh, given how ubiquitous the use of `fromIntegral` is throughout the
> Haskell ecosystem, having 'fromIntegral' suddely emit warnings when
> `-Wall` is active is not realistic IMHO.
Here I disagree.
It is "realistic" because we can just do it, if we want.
The questions more if we want to.
I'd say yes, because:
Deprecation-marking does not break any code, it is the softest way to
make a transition. The Java community has this figured out: Deprecations
are common, they don't break the build, they don't change behaviour,
downstream libraries adapt quickly to them, and the whole ecosystem can
advance to a more solid foundation gracefully.
The way you phrase it sounds as if you'd expect a large backlash from
your users if you emitted these extra warnings.
But I think the opposite can be expected:
Haskell users would love if -Wall pointed out *more* ways in which their
code may break.
We use -Wall because we *want* to be warned of slumbering bugs.
I think your users would cheer at you, not complain.
(Even the C people regularly cheer as new warnings make it into -Wall of
gcc and clang.)
More information about the Libraries
mailing list