Re: [Haskell-cafe] instance Enum Double considerednotentirelygreat?

2011-09-27 Thread Donn Cave
Quoth Chris Smith cdsm...@gmail.com, ... I certainly don't agree that wanting the exact value from a floating point type is a reasonable expectation. The *only* way to recover those results is to do the math with the decimal or rational values instead of floating point numbers. You'll get

Re: [Haskell-cafe] instance Enum Double considerednotentirelygreat?

2011-09-27 Thread Steve Schafer
On Tue, 27 Sep 2011 09:23:20 -0700 (PDT), you wrote: I think it's more than reasonable to expect [0.1,0.2..0.5] == [0.1,0.2,0.3,0.4,0.5] and that would make everyone happy, wouldn't it? [0.1,0.2..0.5] isn't the problem. The problem is coming up with something that not only works for

Re: [Haskell-cafe] instance Enum Double considerednotentirelygreat?

2011-09-27 Thread Chris Smith
On Tue, 2011-09-27 at 09:23 -0700, Donn Cave wrote: I think it's more than reasonable to expect [0.1,0.2..0.5] == [0.1,0.2,0.3,0.4,0.5] and that would make everyone happy, wouldn't it? But what's the justification for that? It *only* makes sense because you used short decimal literals.

Re: [Haskell-cafe] instance Enum Double considerednotentirelygreat?

2011-09-27 Thread Chris Smith
On Tue, 2011-09-27 at 12:36 -0400, Steve Schafer wrote: [0.1,0.2..0.5] isn't the problem. The problem is coming up with something that not only works for [0.1,0.2..0.5], but also works for [0.1,0.2..1234567890.5]. A good rule of thumb: For every proposal that purports to eliminate having to

Re: [Haskell-cafe] instance Enum Double considerednotentirelygreat?

2011-09-27 Thread Steve Schafer
On Tue, 27 Sep 2011 13:13:39 -0600, you wrote: On Tue, 2011-09-27 at 12:36 -0400, Steve Schafer wrote: [0.1,0.2..0.5] isn't the problem. The problem is coming up with something that not only works for [0.1,0.2..0.5], but also works for [0.1,0.2..1234567890.5]. A good rule of thumb: For