Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ranges.
Synopsis
- data Range = Range {}
- rangeInvariant :: Range -> Bool
- newtype Ranges = Ranges [Range]
- rangesInvariant :: Ranges -> Bool
- overlapping :: Range -> Range -> Bool
- empty :: Range -> Bool
- rangeToPositions :: Range -> [Int]
- rangesToPositions :: Ranges -> [Int]
- rToR :: Range -> Ranges
- rangeToEndPoints :: Range -> Maybe (Int, Int)
- minus :: Ranges -> Ranges -> Ranges
Documentation
Character ranges. The first character in the file has position 1.
Note that the to
position is considered to be outside of the
range.
Zero or more consecutive and separated ranges.
Instances
overlapping :: Range -> Range -> Bool Source #
True
iff the ranges overlap.
The ranges are assumed to be well-formed.
rangeToPositions :: Range -> [Int] Source #
Converts a range to a list of positions.
rangesToPositions :: Ranges -> [Int] Source #
Converts several ranges to a list of positions.