Simon Peyton Jones suggested the following changes:
1. Move specification of enumFrom and friends from 3.10 to 6.3.4
2. Specify that for bounded types, (succ maxBound) and (pred minBound) are errors.
3. Specify that succ and pred on numeric types just add/subtract 1 (subject to (2) above.
4. Rewrite D.2 to talk about deriving only, not about Enum in general.
5. In Appendix A, the Enum class defn, add comments to explain that the default methods only work for types whose fromEnum/toEnum range fits=20 inside Int. In addition, I suggest that, since it is widely agreed that the instances of Enum for Float and Double are highly unsatisfactory, the report should give these instances the same status as n+k patterns have (in 1.4 of the recent revision). In particular, their use should be "discouraged", and there should be a warning that the instances may be "altered or removed in Haskell 2".
It might clear the ground somewhat for Haskell 2 if there were a new section containing a list of deprecated features; we can probably think of some other things which should go in there. In addition to what's said for n+k patterns, I suggest the standard explicitly encourage (but not oblige) conforming compilers to issue warnings when deprecated features are used.
Hi! George Russel proposed a search for things which should be deprecated. I have a very distinct unfondness for contexts in algebraic data type declarations. They make absolutely no difference except move type errors to a different part of a program (or rather, they add type errors). In that sense they could be said to be quite harmless, but they dramatically complicate the typing rules for everything involving algebraic data types, especially when combined with labelled fields. Cheers, /kff
George Russell <ger@tzi.de> writes:
In addition, I suggest that, since it is widely agreed that the instances of Enum for Float and Double
And (Ratio a)?
are highly unsatisfactory
-kzm -- If I haven't seen further, it is by standing in the footprints of giants
Ketil Malde wrote:
George Russell <ger@tzi.de> writes:
In addition, I suggest that, since it is widely agreed that the instances of Enum for Float and Double
And (Ratio a)?
Yes, you've got a point there. They'd none of 'em be missed. Of course mathematicians are well aware that rational numbers can be enumerated, just not the way the Haskell standard does it . . .
participants (3)
-
George Russell -
Karl-Filip Faxen -
Ketil Malde