[Haskell-cafe] Remove Enum from Float and Double

Doug McIlroy doug at cs.dartmouth.edu
Wed Jun 19 22:04:41 CEST 2013

 >  it's the entire Enum class which doesn't have a consistent or sensible semantics

Yes, for a language with generally sound mathematical roots, Enum is
an embarrassment. My pet peeve is that Rationals are enumerable, but
not with Enum. And the differing lengths of [1,4..6] and [1.0,4.0..6.0]
will shock even the non-mathematically inclined.

Much of the craziness can be hidden if in place of [a..b] for
nonintegral numeric types, one uses (map fromInteger [a..b]).
Perhaps that should happen automatically.

As for the horror mentioned at the end of the first paragraph,
the language definition's oafish attempt to "get right" things
like [0.0,0.1..1.0] needs major revision.

Doug McIlroy

More information about the Haskell-Cafe mailing list