Commits

Bryan O'Sullivan committed 064293a

Fix an overly cautious bit of arithmetic checking.

Even though the value behind a Size is an Int, we actually intend that those
values should always be non-negative. (We don't use the notionally more
appropriate Word because GHC doesn't do a very good job with it.)

But non-negative means that 0+0 should be 0! Um, oops.

Comments (0)

Files changed (1)

Data/Text/Fusion/Size.hs

                           {-# INLINE f #-}
 
 add :: Int -> Int -> Int
-add m n | mn >    0 = mn
+add m n | mn >=   0 = mn
         | otherwise = overflowError
   where mn = m + n
 {-# INLINE add #-}