[project @ 2001-08-29 09:34:05 by simonmar]
Changes to the Ix class from the revised Haskell 98 report: - Ord is no longer a superclass of Ix. - rangeSize is now a class member, as there are cases when it is useful to be able to override it. As a result, GHC's performance-improving "unsafeRangeSize" function also has to be a class method just in case the programmer has overriden rangeSize. Of course, unsafeRangeSize isn't visible when just importing Ix. - Added unsafeRangeSize bindings to all our standard Ix instances. - Improved the Ix instances for Int{8,16,32,64} and Word{8,16,32,64} by defining unsafeIndex instead of index, and providing a definition of unsafeRangeSize. I hope I haven't mucked anything up :) The array tests all pass successfully, except for arr016 which depended on Ord being a superclass of Ix. I'll commit changes to this test shortly.
Showing
- ghc/lib/std/Ix.lhs 2 additions, 2 deletionsghc/lib/std/Ix.lhs
- ghc/lib/std/PrelArr.lhs 45 additions, 39 deletionsghc/lib/std/PrelArr.lhs
- ghc/lib/std/PrelEnum.lhs 3 additions, 5 deletionsghc/lib/std/PrelEnum.lhs
- ghc/lib/std/PrelInt.lhs 16 additions, 20 deletionsghc/lib/std/PrelInt.lhs
- ghc/lib/std/PrelWord.lhs 20 additions, 25 deletionsghc/lib/std/PrelWord.lhs
Loading
Please register or sign in to comment