<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 17px; border-collapse: collapse; ">The problem I see is that in both:</span><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 17px; border-collapse: collapse; "> Version: September 2006 of hugs, which is the one that is current for Ubuntu 9.10 release, and </span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 17px; border-collapse: collapse; ">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 <div>
explain the problem that I have run into with examples:</div><div><br><div><div>Hugs> [3,7..22]</div><div>[3,7,11,15,19] <- OK</div><div><br></div><div>Hugs> map (* 1.0) [3,7,11,15,19] <- manual spec OK</div>
<div>[3.0,7.0,11.0,15.0,19.0] </div><div><br></div><div>Hugs> map (* 1.0) [3,7..22] <- same spec as first but !!! when</div><div> mapped to with a (*1.0) to coerce </div>
<div> them to reals:</div><div>[3.0,7.0,11.0,15.0,19.0,23.0] <- went one outside of range spec.</div><div><br></div><div>========================================</div><div>
Exactly the same behaviour from ghci 6.10.4 :</div><div><br></div><div><div>Prelude> [3,7..22]</div><div>[3,7,11,15,19]</div><div><br></div><div>Prelude> map (* 1.0) [3,7..22] <- using a range </div><div>
[3.0,7.0,11.0,15.0,19.0,23.0] <- it screws up </div><div> {at least it is not a "feature' to me}</div><div><br></div><div>Prelude> map (* 1.0) [3,7,11,15,19] <- spelled out it acts "right".</div>
<div>[3.0,7.0,11.0,15.0,19.0]</div><div><br></div><div>This seems like a possible bug? or at least a sure fire trap waiting to be sprung ... one of those nasties that could really create havoc if someone is not aware of this behaviour and buries a function that include something that unwittingly coerces from an Integral to a Realfrac or Fractional. Is this a well known thing to watch out for..</div>
<div>or is it something that can be worked around, other then having to</div><div>enumerate every value in a list rather then use the handiness of </div><div>the range notation as shorthand?</div><div><br></div><div>cheers,</div>
<div><br></div><div>gene</div></div></div></div></span><br><br>
</div>