[Haskell-cafe] instance Enum Double considered not entirely great?
jake.mcarthur at gmail.com
Tue Sep 20 17:34:00 CEST 2011
On Tue, Sep 20, 2011 at 10:59 AM, Chris Smith <cdsmith at gmail.com> wrote:
> I certainly hope not. Instead, perhaps the issue should be brought up
> with the fixed-point number library you're using, and they could fix
> their Enum instance to be more helpful.
I'm the author of the library in question. I intentionally chose the
semantics for Enum as it is, although I'm not sure I'm prepared to say
that Enum "should" have this behavior in general. Regardless,
enumerating all values makes more sense to me, and we still have
enumFromThen and enumFromThenTo, so no power is lost anyway. Float and
Double are the only types I know of that don't enumerate all values by
default in enumFrom and enumFromTo.
More information about the Haskell-Cafe