Safe Haskell | None |
---|

Ranges.

- data Range = Range {}
- rangeInvariant :: Range -> Bool
- newtype Ranges = Ranges [Range]
- rangesInvariant :: Ranges -> Bool
- overlapping :: Range -> Range -> Bool
- empty :: Range -> Bool
- rangeToPositions :: Range -> [Integer]
- rangesToPositions :: Ranges -> [Integer]
- rToR :: Range -> Ranges
- minus :: Ranges -> Ranges -> Ranges
- tests :: IO Bool

# 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.

rangeInvariant :: Range -> BoolSource

The `Range`

invariant.

Zero or more consecutive and separated ranges.

rangesInvariant :: Ranges -> BoolSource

The `Ranges`

invariant.

overlapping :: Range -> Range -> BoolSource

`True`

iff the ranges overlap.

The ranges are assumed to be well-formed.

rangeToPositions :: Range -> [Integer]Source

Converts a range to a list of positions.

rangesToPositions :: Ranges -> [Integer]Source

Converts several ranges to a list of positions.