1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

🔥 offsetRange.

This commit is contained in:
Rob Rix 2019-09-20 08:53:16 -04:00
parent 7bb8fe4aaf
commit 775f6a131c
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -3,7 +3,6 @@ module Data.Range
( Range(..)
, emptyRange
, rangeLength
, offsetRange
, intersectsRange
, subtractRange
) where
@ -24,10 +23,6 @@ emptyRange = Range 0 0
rangeLength :: Range -> Int
rangeLength range = end range - start range
-- | Offset a range by a constant delta.
offsetRange :: Range -> Int -> Range
offsetRange a b = Range (start a + b) (end a + b)
-- | Test two ranges for intersection.
intersectsRange :: Range -> Range -> Bool
intersectsRange range1 range2 = start range1 < end range2 && start range2 < end range1