1
1
mirror of https://github.com/github/semantic.git synced 2025-01-09 00:56:32 +03:00

📝 intersectsRange.

This commit is contained in:
Rob Rix 2016-04-15 09:34:58 -04:00
parent 012425b11a
commit 92b4fcba1b

View File

@ -47,6 +47,7 @@ maybeLastIndex :: Range -> Maybe Int
maybeLastIndex (Range start end) | start == end = Nothing
maybeLastIndex (Range _ end) = Just $ end - 1
-- | Test two ranges for intersection.
intersectsRange :: Range -> Range -> Bool
intersectsRange range1 range2 = end range2 <= end range1