Ross, thanks for spotting this.
It's because unsafeRangeSize is supposed to have the same meaning as
rangeSize. If someone defines an instance of Ix and overrides
rangeSize, then unsafeRangeSize should continue to behave like rangeSize
(remember, unsafeRangeSize isn't part of the exposed interface of
Data.Ix, so clients of that interface can only define rangeSize).
The default method for unsafeRangeSize should be changed back, I think.
Cheers,
Simon
On 12 April 2005 16:09, Simon Peyton-Jones wrote:
> I couldn't figure out why -- and you get much better performance this
> way. Anyone who sees a probem with defining unsafeRange size in terms
> of unsafeIndex, please yell. The 'deriving(Ix)' stuff now does the
> same.
>
> Simon
>
>> -----Original Message-----
>> From: Ross Paterson [mailto:[EMAIL PROTECTED]
>> Sent: 12 April 2005 13:27
>> To: Simon Peyton Jones
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: cvs commit: fptools/libraries/base/GHC Arr.lhs
>>
>> On Mon, Apr 04, 2005 at 05:16:45AM -0700, Simon Peyton Jones wrote:
>>> simonpj 2005/04/04 05:16:45 PDT
>>>
>>> Modified files:
>>> libraries/base/GHC Arr.lhs
>>> Log:
>>> Default method for unsafeRangeSize should use unsafeIndex!
>>
>> Hmm. When unsafeRangeSize was made a method (ghc/lib/std/PrelArr.lhs
>> rev. 1.29), this seems to have been deliberately avoided, with the
>> definition using unsafeIndex in all the instances. I wonder why.
> _______________________________________________
> Cvs-libraries mailing list
> [EMAIL PROTECTED]
> http://www.haskell.org/mailman/listinfo/cvs-libraries
_______________________________________________
Cvs-libraries mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-libraries