[Haskell-cafe] instance Enum Double considered notentirelygreat?
ketil at malde.org
Tue Sep 27 19:34:22 CEST 2011
Iavor Diatchki <iavor.diatchki at gmail.com> writes:
>>> last ([0.1, 0.2 .. 0.5]) == 0.5
>>> last (map fromRational [0.1, 0.2 .. 0.5]) == 0.5
> As Ross pointed out in a previous e-mail the instance for Rationals is
> also broken:
>> last (map fromRational [1,3 .. 20])
But only because it tries to mimic the behavior of Float/Double, I
think. Rational could easily have produced 19 here.
If I haven't seen further, it is by standing in the footprints of giants
More information about the Haskell-Cafe