Repair to floating point enumerations?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Oct 15 14:17:42 EDT 2008


On Wed, 2008-10-15 at 11:25 +0100, Mitchell, Neil wrote:
> Hi Malcolm,
> 
> The current behaviour does sound like a bug, and the revised behaviour
> does sound like a fix - and one that has a sensible explanation if
> people trip over it. In general having floating point be a member of
> classes such as Eq has some obvious problems, but I realise is a
> necessity for practical programming. Given that we have Eq Double, then
> Enum Double seems no worse.
> 
> If we don't alter H98 then a valid program under H98 vs H' will give
> different results without any warning - that seems really bad. In
> addition, having two instances around for one typeclass/type pair in a
> big library (base) which are switched with some flag seems like a
> nightmare for compiler writers. So I think a good solution would be to
> fix H98 as a typo, and include it in H'.

I would take the contrary position and say H98 should be left alone and
the change should be proposed for H'.

The argument is that H98 is done and the revised report was published 7
years ago. Changing H98 now just doesn't seem to make much sense.

If we're talking about changing the meaning of 'valid' programs then
doing that at a boundary like H98 -> H' seems much more sensible than
having to explain the difference in H98-pre2008 programs vs
H98-post2008.

People will not expect all programs to be exactly the same between H98
and H' (otherwise there would be little need for a new standard). Yes H'
is mostly compatible extensions but not all of it.

Duncan



More information about the Haskell-prime mailing list