Re: [Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-08 Thread Malcolm Wallace
Hugs [3,7..22] [3,7,11,15,19] - OK Hugs map (* 1.0) [3,7..22] - same spec as first but !!! when mapped to with a (*1.0) to coerce them to reals: [3.0,7.0,11.0,15.0,19.0,23.0] - went one

Re: [Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-08 Thread Jonas Almström Duregård
An easier way of demonstrating this issue: Prelude [3,7..22]::[Int] [3,7,11,15,19] Prelude [3,7..22]::[Double] [3.0,7.0,11.0,15.0,19.0,23.0] /Jonas On 8 May 2010 09:47, Malcolm Wallace malcolm.wall...@cs.york.ac.uk wrote: Hugs [3,7..22] [3,7,11,15,19]     - OK Hugs map (* 1.0) [3,7..22]  

[Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-07 Thread Gene A
The problem I see is that in both: Version: September 2006 of hugs, which is the one that is current for Ubuntu 9.10 release, and ghci 6.10.4, they both exhibit a {I think} strange behaviour, in regards to the shorthand way of calling out a list of enumerable values. I will explain the problem

Re: [Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-07 Thread Ivan Lazar Miljenovic
Gene A yumag...@gmail.com writes: The problem I see is that in both: Version: September 2006 of hugs, which is the one that is current for Ubuntu 9.10 release, and ghci 6.10.4, they both exhibit a {I think} strange behaviour, in regards to the shorthand way of calling out a list of

Re: [Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-07 Thread Roel van Dijk
From the Haskell 98 report (section 6.3.4): For Float and Double, the semantics of the enumFrom family is given by the rules for Int above, except that the list terminates when the elements become greater than e3+i/2 for positive increment i, or when they become less than e3+i/2 for