Remove Enum from Float and Double
f.manners at gmail.com
Tue Jun 11 21:04:40 CEST 2013
More to supply evidence in answer to your question than to present a point
of view, the following is an example of code I wrote fairly recently:
phi :: Double -> Double -> Complex Double
phi x y = sum [ exp((-pi * (x + n)^2) :+ (2 * pi * n * y)) | n <-
I wouldn't claim for a second that this is good style, but the point is
that I don't actually care in this instance whether I gain or lose one or
two terms in the sum (they're all vanishingly small by that point) so I
think this is in some sense legitimate. I could of course take n as an
integer, but in this rather cheap-and-dirty program I made a conscious
trade-off in favour of readability and against lots of fromIntegral's.
I don't have strong views either way as to whether the language should
coerce me into being a better person in this sense, but my point is just
that this proposal would break not-unreasonable code -- how much depending
on how many people ever use Haskell for numerical work.
On 11 June 2013 19:18, harry <voldermort at hotmail.com> wrote:
> Johan Tibell <johan.tibell at ...> writes:
> > I don't see much gain. It will break previously working code and the
> workaround to the breakage will likely be manually reimplementing
> in each instance.
> I forgot the main point of my post :-)
> The primary motivation for removing these instances is that they cause
> endless confusion for beginners, e.g.
> and many more.
> On the other hand, how much working code is there "correctly" using there
> Haskell-prime mailing list
> Haskell-prime at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-prime