Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
Data Pos Source # | |
Defined in Data.Loc.Pos gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pos -> c Pos # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Pos # dataTypeOf :: Pos -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Pos) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pos) # gmapT :: (forall b. Data b => b -> b) -> Pos -> Pos # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pos -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pos -> r # gmapQ :: (forall d. Data d => d -> u) -> Pos -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Pos -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pos -> m Pos # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pos -> m Pos # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pos -> m Pos # | |
Enum Pos Source # |
|
Num Pos Source # |
|
Read Pos Source # | |
Real Pos Source # | |
Defined in Data.Loc.Pos toRational :: Pos -> Rational # | |
Show Pos Source # | |
Eq Pos Source # | |
Ord Pos Source # | |
ToNat Pos Source # | |
Instances
Data Line Source # | |
Defined in Data.Loc.Pos gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Line -> c Line # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Line # dataTypeOf :: Line -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Line) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Line) # gmapT :: (forall b. Data b => b -> b) -> Line -> Line # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Line -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Line -> r # gmapQ :: (forall d. Data d => d -> u) -> Line -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Line -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Line -> m Line # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Line -> m Line # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Line -> m Line # | |
Enum Line Source # | |
Num Line Source # | |
Read Line Source # | |
Real Line Source # | |
Defined in Data.Loc.Pos toRational :: Line -> Rational # | |
Show Line Source # | |
Eq Line Source # | |
Ord Line Source # | |
ToNat Line Source # | |
Instances
Data Column Source # | |
Defined in Data.Loc.Pos gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Column -> c Column # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Column # toConstr :: Column -> Constr # dataTypeOf :: Column -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Column) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Column) # gmapT :: (forall b. Data b => b -> b) -> Column -> Column # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Column -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Column -> r # gmapQ :: (forall d. Data d => d -> u) -> Column -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Column -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Column -> m Column # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Column -> m Column # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Column -> m Column # | |
Enum Column Source # | |
Defined in Data.Loc.Pos | |
Num Column Source # | |
Read Column Source # | |
Real Column Source # | |
Defined in Data.Loc.Pos toRational :: Column -> Rational # | |
Show Column Source # | |
Eq Column Source # | |
Ord Column Source # | |
ToNat Column 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.
Instances
Data Loc Source # | |
Defined in Data.Loc.Loc gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Loc -> c Loc # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Loc # dataTypeOf :: Loc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Loc) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Loc) # gmapT :: (forall b. Data b => b -> b) -> Loc -> Loc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r # gmapQ :: (forall d. Data d => d -> u) -> Loc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Loc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Loc -> m Loc # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Loc -> m Loc # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Loc -> m Loc # | |
Read Loc Source # | |
Show Loc Source # | |
Eq Loc Source # | |
Ord Loc Source # | |
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 -
.
Instances
Data Span Source # | |
Defined in Data.Loc.Span gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Span -> c Span # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Span # dataTypeOf :: Span -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Span) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Span) # gmapT :: (forall b. Data b => b -> b) -> Span -> Span # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Span -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Span -> r # gmapQ :: (forall d. Data d => d -> u) -> Span -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Span -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Span -> m Span # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Span -> m Span # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Span -> m Span # | |
Read Span Source # | |
Show Span Source # | |
Eq Span Source # | |
Ord Span Source # | |
A SpanOrLoc
consists of a start location and an end location.
The end location must be greater than or equal to the start location;
in other words, backwards spans are not permitted.
If the start and end location are the same, then the value is a SpanOrLoc
.
If they differ, then the value is a SpanOrLoc
.
Instances
Data SpanOrLoc Source # | |
Defined in Data.Loc.SpanOrLoc gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpanOrLoc -> c SpanOrLoc # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SpanOrLoc # toConstr :: SpanOrLoc -> Constr # dataTypeOf :: SpanOrLoc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SpanOrLoc) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpanOrLoc) # gmapT :: (forall b. Data b => b -> b) -> SpanOrLoc -> SpanOrLoc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpanOrLoc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpanOrLoc -> r # gmapQ :: (forall d. Data d => d -> u) -> SpanOrLoc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SpanOrLoc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpanOrLoc -> m SpanOrLoc # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanOrLoc -> m SpanOrLoc # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanOrLoc -> m SpanOrLoc # | |
Show SpanOrLoc Source # | |
Eq SpanOrLoc Source # | |
Ord SpanOrLoc Source # | |
Defined in Data.Loc.SpanOrLoc |
A set of non-overlapping, non-abutting Span
s. 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 -
.
Instances
Data Area Source # | |
Defined in Data.Loc.Area gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Area -> c Area # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Area # dataTypeOf :: Area -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Area) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Area) # gmapT :: (forall b. Data b => b -> b) -> Area -> Area # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Area -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Area -> r # gmapQ :: (forall d. Data d => d -> u) -> Area -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Area -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Area -> m Area # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Area -> m Area # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Area -> m Area # | |
Monoid Area Source # | |
Semigroup Area Source # | |
Read Area Source # | |
Show Area Source # | |
Eq Area Source # | |
Ord Area Source # | |