cvs commit: fptools/libraries/base/GHC Arr.lhs

Simon Marlow simonmar at microsoft.com
Wed Apr 13 06:35:42 EDT 2005


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:ross at soi.city.ac.uk]
>> Sent: 12 April 2005 13:27
>> To: Simon Peyton Jones
>> Cc: cvs-libraries at haskell.org
>> 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
> Cvs-libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/cvs-libraries



More information about the Cvs-libraries mailing list