Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This modules provides data types that describe line-column locations within a text.
- class HasLoc α where
- type LocOf α
- class HasLoc α => LocLens α where
- data Span l = Span l l
- class SpannedLoc l where
- type SpanLoc l
- locStart :: SpannedLoc l => l -> SpanLoc l
- locEnd :: SpannedLoc l => l -> SpanLoc l
- spanOf :: (HasLoc α, SpannedLoc (LocOf α)) => α -> Span (SpanLoc (LocOf α))
- startOf :: (HasLoc α, SpannedLoc (LocOf α)) => α -> SpanLoc (LocOf α)
- endOf :: (HasLoc α, SpannedLoc (LocOf α)) => α -> SpanLoc (LocOf α)
- class SpannedLoc l => SpannedLens l where
- lStart :: (Functor f, SpannedLens l) => (SpanLoc l -> f (SpanLoc l)) -> l -> f l
- lEnd :: (Functor f, SpannedLens l) => (SpanLoc l -> f (SpanLoc l)) -> l -> f l
- lSpanOf :: (Functor f, LocLens α, SpannedLens (LocOf α)) => (Span (SpanLoc (LocOf α)) -> f (Span (SpanLoc (LocOf α)))) -> α -> f α
- lEndOf :: (Functor f, LocLens α, SpannedLens (LocOf α)) => (SpanLoc (LocOf α) -> f (SpanLoc (LocOf α))) -> α -> f α
- lStartOf :: (Functor f, LocLens α, SpannedLens (LocOf α)) => (SpanLoc (LocOf α) -> f (SpanLoc (LocOf α))) -> α -> f α
- data Located l α = Located {}
- data LineCol = LineCol !Word !Word
- nextLine :: LineCol -> LineCol
- nextCol :: LineCol -> LineCol
- class LineColLoc l where
- locLine :: LineColLoc l => l -> Word
- locCol :: LineColLoc l => l -> Word
- lineColOf :: (HasLoc α, LineColLoc (LocOf α)) => α -> LineCol
- lineOf :: (HasLoc α, LineColLoc (LocOf α)) => α -> Word
- colOf :: (HasLoc α, LineColLoc (LocOf α)) => α -> Word
- class LineColLens l where
- lLine :: (Functor f, LineColLens l) => (Word -> f Word) -> l -> f l
- lCol :: (Functor f, LineColLens l) => (Word -> f Word) -> l -> f l
- lLineColOf :: (Functor f, LocLens α, LineColLens (LocOf α)) => (LineCol -> f LineCol) -> α -> f α
- lLineOf :: (Functor f, LocLens α, LineColLens (LocOf α)) => (Word -> f Word) -> α -> f α
- lColOf :: (Functor f, LocLens α, LineColLens (LocOf α)) => (Word -> f Word) -> α -> f α
- class SrcLoc l where
- type LocSrc l
- srcOf :: (HasLoc α, SrcLoc (LocOf α)) => α -> LocSrc (LocOf α)
- class SrcLoc l => SrcLens l where
- lSrcOf :: (Functor f, LocLens α, SrcLens (LocOf α)) => (LocSrc (LocOf α) -> f (LocSrc (LocOf α))) -> α -> f α
- data InSrc s l = InSrc {}
- class FromLoc l where
- type LocFrom l
- fromOf :: (HasLoc α, FromLoc (LocOf α)) => α -> LocFrom (LocOf α)
- class FromLoc l => FromLens l where
- lFromOf :: (Functor f, LocLens α, FromLens (LocOf α)) => (LocFrom (LocOf α) -> f (LocFrom (LocOf α))) -> α -> f α
- data Nested l p = Nested {
- nestedLoc :: l
- nestedFrom :: p
Documentation
Values with associated source locations.
A region of text between two locations.
Span l l |
Functor Span Source # | |
Foldable Span Source # | |
Traversable Span Source # | |
Eq l => Eq (Span l) Source # | |
Ord l => Ord (Span l) Source # | |
Read l => Read (Span l) Source # | |
Show l => Show (Span l) Source # | |
Generic (Span l) Source # | |
Hashable l => Hashable (Span l) Source # | |
SpannedLens (Span l) Source # | |
SpannedLoc (Span l) Source # | |
LocLens (Span l) Source # | |
HasLoc (Span l) Source # | |
type Rep (Span l) Source # | |
type SpanLoc (Span l) Source # | |
type LocOf (Span l) Source # | |
class SpannedLoc l where Source #
Spanned locations.
SpannedLoc (Span l) Source # | |
SpannedLoc l => SpannedLoc (Nested l p) Source # | |
SpannedLoc l => SpannedLoc (InSrc s l) Source # | |
locStart :: SpannedLoc l => l -> SpanLoc l Source #
The start of a span.
locEnd :: SpannedLoc l => l -> SpanLoc l Source #
The end of a span.
spanOf :: (HasLoc α, SpannedLoc (LocOf α)) => α -> Span (SpanLoc (LocOf α)) Source #
The span of the associated location.
startOf :: (HasLoc α, SpannedLoc (LocOf α)) => α -> SpanLoc (LocOf α) Source #
The start of the associated location.
endOf :: (HasLoc α, SpannedLoc (LocOf α)) => α -> SpanLoc (LocOf α) Source #
The end of the associated location.
class SpannedLoc l => SpannedLens l where Source #
Editable spanned locations.
SpannedLens (Span l) Source # | |
SpannedLens l => SpannedLens (Nested l p) Source # | |
SpannedLens l => SpannedLens (InSrc s l) Source # | |
lStart :: (Functor f, SpannedLens l) => (SpanLoc l -> f (SpanLoc l)) -> l -> f l Source #
Provides access to the start of a location.
lEnd :: (Functor f, SpannedLens l) => (SpanLoc l -> f (SpanLoc l)) -> l -> f l Source #
Provides access to the end of a location.
lSpanOf :: (Functor f, LocLens α, SpannedLens (LocOf α)) => (Span (SpanLoc (LocOf α)) -> f (Span (SpanLoc (LocOf α)))) -> α -> f α Source #
Provides access to the span of the associated location.
lEndOf :: (Functor f, LocLens α, SpannedLens (LocOf α)) => (SpanLoc (LocOf α) -> f (SpanLoc (LocOf α))) -> α -> f α Source #
Provides access to the end of the associated location.
lStartOf :: (Functor f, LocLens α, SpannedLens (LocOf α)) => (SpanLoc (LocOf α) -> f (SpanLoc (LocOf α))) -> α -> f α Source #
Provides access to the start of the associated location.
A simple way to attach location to a value.
Functor (Located l) Source # | |
Foldable (Located l) Source # | |
Traversable (Located l) Source # | |
(Read l, Read α) => Read (Located l α) Source # | |
(Show l, Show α) => Show (Located l α) Source # | |
Generic (Located l α) Source # | |
(Hashable l, Hashable α) => Hashable (Located l α) Source # | |
LocLens (Located l α) Source # | |
HasLoc (Located l α) Source # | |
type Rep (Located l α) Source # | |
type LocOf (Located l α) Source # | |
Line-column location within a text.
class LineColLoc l where Source #
Locations with line and column numbers.
locLineCol :: l -> LineCol Source #
LineColLoc LineCol Source # | |
LineColLoc l => LineColLoc (Nested l p) Source # | |
LineColLoc l => LineColLoc (InSrc s l) Source # | |
locLine :: LineColLoc l => l -> Word Source #
The line number of a location.
locCol :: LineColLoc l => l -> Word Source #
The column number of a location.
lineColOf :: (HasLoc α, LineColLoc (LocOf α)) => α -> LineCol Source #
The line-column numbers of the associated location.
lineOf :: (HasLoc α, LineColLoc (LocOf α)) => α -> Word Source #
The line number of the associated location.
colOf :: (HasLoc α, LineColLoc (LocOf α)) => α -> Word Source #
The column number of the associated location.
class LineColLens l where Source #
Locations with editable line and column numbers.
LineColLens LineCol Source # | |
LineColLens l => LineColLens (Nested l p) Source # | |
LineColLens l => LineColLens (InSrc s l) Source # | |
lLine :: (Functor f, LineColLens l) => (Word -> f Word) -> l -> f l Source #
Provides access to the line number of a location.
lCol :: (Functor f, LineColLens l) => (Word -> f Word) -> l -> f l Source #
Provides access to the column number of a location.
lLineColOf :: (Functor f, LocLens α, LineColLens (LocOf α)) => (LineCol -> f LineCol) -> α -> f α Source #
Provides access to the line-column numbers of the associated location.
lLineOf :: (Functor f, LocLens α, LineColLens (LocOf α)) => (Word -> f Word) -> α -> f α Source #
Provides access to the line number of the associated location.
lColOf :: (Functor f, LocLens α, LineColLens (LocOf α)) => (Word -> f Word) -> α -> f α Source #
Provides access to the column number of the associated location.
Locations with a source (e.g. file name).
srcOf :: (HasLoc α, SrcLoc (LocOf α)) => α -> LocSrc (LocOf α) Source #
The source of the associated location.
lSrcOf :: (Functor f, LocLens α, SrcLens (LocOf α)) => (LocSrc (LocOf α) -> f (LocSrc (LocOf α))) -> α -> f α Source #
Provides access to the source of the associated location.
A simple way to add source to a location.
(Eq s, Eq l) => Eq (InSrc s l) Source # | |
(Ord s, Ord l) => Ord (InSrc s l) Source # | |
(Read s, Read l) => Read (InSrc s l) Source # | |
(Show s, Show l) => Show (InSrc s l) Source # | |
Generic (InSrc s l) Source # | |
(Hashable s, Hashable l) => Hashable (InSrc s l) Source # | |
FromLens l => FromLens (InSrc s l) Source # | |
FromLoc l => FromLoc (InSrc s l) Source # | |
SrcLens (InSrc s l) Source # | |
SrcLoc (InSrc s l) Source # | |
LineColLens l => LineColLens (InSrc s l) Source # | |
LineColLoc l => LineColLoc (InSrc s l) Source # | |
SpannedLens l => SpannedLens (InSrc s l) Source # | |
SpannedLoc l => SpannedLoc (InSrc s l) Source # | |
LocLens (InSrc s l) Source # | |
HasLoc (InSrc s l) Source # | |
type Rep (InSrc s l) Source # | |
type LocFrom (InSrc s l) Source # | |
type LocSrc (InSrc s l) Source # | |
type SpanLoc (InSrc s l) Source # | |
type LocOf (InSrc s l) Source # | |
fromOf :: (HasLoc α, FromLoc (LocOf α)) => α -> LocFrom (LocOf α) Source #
The parent of the associated location.
lFromOf :: (Functor f, LocLens α, FromLens (LocOf α)) => (LocFrom (LocOf α) -> f (LocFrom (LocOf α))) -> α -> f α Source #
Provides access to the parent of the associated location.
A simple way to nest a location.
Nested | |
|
(Read l, Read p) => Read (Nested l p) Source # | |
(Show l, Show p) => Show (Nested l p) Source # | |
Generic (Nested l p) Source # | |
(Hashable l, Hashable p) => Hashable (Nested l p) Source # | |
FromLens (Nested l p) Source # | |
FromLoc (Nested l p) Source # | |
SrcLens l => SrcLens (Nested l p) Source # | |
SrcLoc l => SrcLoc (Nested l p) Source # | |
LineColLens l => LineColLens (Nested l p) Source # | |
LineColLoc l => LineColLoc (Nested l p) Source # | |
SpannedLens l => SpannedLens (Nested l p) Source # | |
SpannedLoc l => SpannedLoc (Nested l p) Source # | |
LocLens (Nested l p) Source # | |
HasLoc (Nested l p) Source # | |
type Rep (Nested l p) Source # | |
type LocFrom (Nested l p) Source # | |
type LocSrc (Nested l p) Source # | |
type SpanLoc (Nested l p) Source # | |
type LocOf (Nested l p) Source # | |