mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Define a point fiunction for Range.
This commit is contained in:
parent
0312300a40
commit
e08a49596e
@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE DeriveGeneric, RankNTypes #-}
|
||||
module Source.Range
|
||||
( Range(..)
|
||||
, point
|
||||
, rangeLength
|
||||
, subtractRange
|
||||
-- * Lenses
|
||||
@ -32,6 +33,9 @@ instance Lower Range where
|
||||
lowerBound = Range 0 0
|
||||
|
||||
|
||||
point :: Int -> Range
|
||||
point i = Range i i
|
||||
|
||||
-- | Return the length of the range.
|
||||
rangeLength :: Range -> Int
|
||||
rangeLength range = end range - start range
|
||||
|
Loading…
Reference in New Issue
Block a user