User defined Ix instances potentially unsafe

Fergus Henderson fjh@cs.mu.oz.au
Sat, 5 May 2001 18:48:18 +1000


On 02-May-2001, Matt Harden <matth@mindspring.com> wrote:
> Matt Harden wrote:
> 
> > blah, blah, blah, bug in the Library Report, blah, blah...
> 
> OK, so I failed to read the Library Report.  It clearly states:
> 
> > An implementation is entitled to assume the following laws about these operations: 
> > 
> >         range (l,u) !! index (l,u) i == i   -- when i is in range
> >         inRange (l,u) i == i `elem` range (l,u)
> 
> So my "bug" is only in my mind.  Sorry for bothering everyone.

I don't think it's quite as straight-forward as that.
Hugs and ghc may conform to the Library Report, but the
behaviour is still undesirable, and IMHO should be fixed.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.