projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4977f15
)
[project @ 1997-05-18 04:06:57 by sof]
author
sof
<unknown>
Sun, 18 May 1997 04:06:57 +0000
(
04:06
+0000)
committer
sof
<unknown>
Sun, 18 May 1997 04:06:57 +0000
(
04:06
+0000)
rangeSize copes with empty intervals
ghc/lib/required/Ix.lhs
patch
|
blob
|
history
diff --git
a/ghc/lib/required/Ix.lhs
b/ghc/lib/required/Ix.lhs
index
afafe24
..
0da9e1a
100644
(file)
--- a/
ghc/lib/required/Ix.lhs
+++ b/
ghc/lib/required/Ix.lhs
@@
-161,6
+161,8
@@
in the range for an @Ix@ pair:
\begin{code}
rangeSize :: (Ix a) => (a,a) -> Int
-rangeSize b@(_,high) = index b high + 1
+rangeSize b@(l,h)
+ | l > h = 0
+ | otherwise = index b h + 1
\end{code}