mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Add a rangeAt function to construct a Range at an index.
This commit is contained in:
parent
5bbca4cf8d
commit
9108b56e4f
@ -11,6 +11,10 @@ import Data.Option
|
||||
data Range = Range { start :: !Int, end :: !Int }
|
||||
deriving (Eq, Show)
|
||||
|
||||
-- | Make a range at a given index.
|
||||
rangeAt :: Int -> Range
|
||||
rangeAt a = Range a a
|
||||
|
||||
-- | Return the length of the range.
|
||||
rangeLength :: Range -> Int
|
||||
rangeLength range = end range - start range
|
||||
|
Loading…
Reference in New Issue
Block a user