Safe Haskell | None |
---|---|

Language | Haskell98 |

Ranges.

- 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
- 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 -> Bool Source

The `Range`

invariant.

Zero or more consecutive and separated ranges.

rangesInvariant :: Ranges -> Bool Source

The `Ranges`

invariant.

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.