| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Loc.Types
Description
For convenience, this module exports only the important types from Loc.
Documentation
Pos stands for positive integer. You can also think of it as position,
because we use it to represent line and column numbers (Line and Column).
Pos has instances of several of the standard numeric typeclasses, although
many of the operations throw Underflow when non-positive values result.
Pos does not have an Integral instance, because there is no sensible
way to implement quotRem.
Instances
| Enum Pos Source # |
|
| Eq Pos Source # | |
| Num Pos Source # |
|
| Ord Pos Source # | |
| Read Pos Source # | |
| Real Pos Source # | |
Defined in Data.Loc.Pos Methods toRational :: Pos -> Rational # | |
| Show Pos Source # | |
| ToNat Pos Source # | |
Stands for location. Consists of a Line and a Column. You can think of a
Loc like a caret position in a text editor. Following the normal convention
for text editors and such, line and column numbers start with 1.
A Span consists of a start location (start) and an end location (end).
The end location must be greater than the start location; in other words, empty
or backwards spans are not permitted.
Construct and combine spans using fromTo, fromToMay, +, and -.
A set of non-overlapping, non-abutting Spans. You may also think of an Area
like a span that can be empty or have “gaps”.
Construct and combine areas using mempty, spanArea, fromTo, +, and -.