Deprecating fromIntegral

Henning Thielemann lemming at henning-thielemann.de
Sat Sep 23 21:28:29 UTC 2017


On Fri, 22 Sep 2017, Evan Laforge wrote:

> However, a lot of those I think would be false positives, because
> they're converting across newtypes, where the underlying type is the
> same.  I'm not sure what I would use for those... I guess it would be
> fromIntegerWrapped, but it's kind of verbose and awkward and is
> implying wrapping when it's not actually present.  Maybe they should
> be using 'coerce'?

Why not just use the newtype constructor or field accessor for packing and 
unpacking? Usually I wrap Ints in newtypes for identifiers. Identifiers 
should not support Num arithmetic and thus would not allow fromIntegral 
anyway.


More information about the Libraries mailing list