text-loc-0.1.1: Line-column locations within a text.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Loc

Description

This modules provides data types that describe line-column locations within a text.

Synopsis

Documentation

class HasLoc α where Source #

Values with associated source locations.

Associated Types

type LocOf α Source #

Methods

locOf :: α -> LocOf α Source #

Instances

Instances details
HasLoc LineCol Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf LineCol Source #

HasLoc (Span l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (Span l) Source #

Methods

locOf :: Span l -> LocOf (Span l) Source #

HasLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (InSrc s l) Source #

Methods

locOf :: InSrc s l -> LocOf (InSrc s l) Source #

HasLoc (Located l α) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (Located l α) Source #

Methods

locOf :: Located l α -> LocOf (Located l α) Source #

HasLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (Nested l p) Source #

Methods

locOf :: Nested l p -> LocOf (Nested l p) Source #

class HasLoc α => LocLens α where Source #

Values with editable associated source locations.

Methods

lLocOf :: Functor f => (LocOf α -> f (LocOf α)) -> α -> f α Source #

Instances

Instances details
LocLens (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (Span l) -> f (LocOf (Span l))) -> Span l -> f (Span l) Source #

LocLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (InSrc s l) -> f (LocOf (InSrc s l))) -> InSrc s l -> f (InSrc s l) Source #

LocLens (Located l α) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (Located l α) -> f (LocOf (Located l α))) -> Located l α -> f (Located l α) Source #

LocLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (Nested l p) -> f (LocOf (Nested l p))) -> Nested l p -> f (Nested l p) Source #

data Span l Source #

A region of text between two locations.

Constructors

Span l l 

Instances

Instances details
Foldable Span Source # 
Instance details

Defined in Text.Loc

Methods

fold :: Monoid m => Span m -> m #

foldMap :: Monoid m => (a -> m) -> Span a -> m #

foldMap' :: Monoid m => (a -> m) -> Span a -> m #

foldr :: (a -> b -> b) -> b -> Span a -> b #

foldr' :: (a -> b -> b) -> b -> Span a -> b #

foldl :: (b -> a -> b) -> b -> Span a -> b #

foldl' :: (b -> a -> b) -> b -> Span a -> b #

foldr1 :: (a -> a -> a) -> Span a -> a #

foldl1 :: (a -> a -> a) -> Span a -> a #

toList :: Span a -> [a] #

null :: Span a -> Bool #

length :: Span a -> Int #

elem :: Eq a => a -> Span a -> Bool #

maximum :: Ord a => Span a -> a #

minimum :: Ord a => Span a -> a #

sum :: Num a => Span a -> a #

product :: Num a => Span a -> a #

Traversable Span Source # 
Instance details

Defined in Text.Loc

Methods

traverse :: Applicative f => (a -> f b) -> Span a -> f (Span b) #

sequenceA :: Applicative f => Span (f a) -> f (Span a) #

mapM :: Monad m => (a -> m b) -> Span a -> m (Span b) #

sequence :: Monad m => Span (m a) -> m (Span a) #

Functor Span Source # 
Instance details

Defined in Text.Loc

Methods

fmap :: (a -> b) -> Span a -> Span b #

(<$) :: a -> Span b -> Span a #

Generic (Span l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type Rep (Span l) :: Type -> Type #

Methods

from :: Span l -> Rep (Span l) x #

to :: Rep (Span l) x -> Span l #

Read l => Read (Span l) Source # 
Instance details

Defined in Text.Loc

Show l => Show (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

showsPrec :: Int -> Span l -> ShowS #

show :: Span l -> String #

showList :: [Span l] -> ShowS #

Eq l => Eq (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

(==) :: Span l -> Span l -> Bool #

(/=) :: Span l -> Span l -> Bool #

Ord l => Ord (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

compare :: Span l -> Span l -> Ordering #

(<) :: Span l -> Span l -> Bool #

(<=) :: Span l -> Span l -> Bool #

(>) :: Span l -> Span l -> Bool #

(>=) :: Span l -> Span l -> Bool #

max :: Span l -> Span l -> Span l #

min :: Span l -> Span l -> Span l #

Hashable l => Hashable (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

hashWithSalt :: Int -> Span l -> Int #

hash :: Span l -> Int #

HasLoc (Span l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (Span l) Source #

Methods

locOf :: Span l -> LocOf (Span l) Source #

LocLens (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (Span l) -> f (LocOf (Span l))) -> Span l -> f (Span l) Source #

SpannedLens (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

lSpan :: Functor f => (Span (SpanLoc (Span l)) -> f (Span (SpanLoc (Span l)))) -> Span l -> f (Span l) Source #

SpannedLoc (Span l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type SpanLoc (Span l) Source #

Methods

locSpan :: Span l -> Span (SpanLoc (Span l)) Source #

type Rep (Span l) Source # 
Instance details

Defined in Text.Loc

type Rep (Span l) = D1 ('MetaData "Span" "Text.Loc" "text-loc-0.1.1-GlWx6SfF9Kx4Cq6FohOQm8" 'False) (C1 ('MetaCons "Span" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 l) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 l)))
type LocOf (Span l) Source # 
Instance details

Defined in Text.Loc

type LocOf (Span l) = Span l
type SpanLoc (Span l) Source # 
Instance details

Defined in Text.Loc

type SpanLoc (Span l) = l

class SpannedLoc l where Source #

Spanned locations.

Associated Types

type SpanLoc l Source #

Methods

locSpan :: l -> Span (SpanLoc l) Source #

Instances

Instances details
SpannedLoc (Span l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type SpanLoc (Span l) Source #

Methods

locSpan :: Span l -> Span (SpanLoc (Span l)) Source #

SpannedLoc l => SpannedLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type SpanLoc (InSrc s l) Source #

Methods

locSpan :: InSrc s l -> Span (SpanLoc (InSrc s l)) Source #

SpannedLoc l => SpannedLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type SpanLoc (Nested l p) Source #

Methods

locSpan :: Nested l p -> Span (SpanLoc (Nested l p)) 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.

Methods

lSpan :: Functor f => (Span (SpanLoc l) -> f (Span (SpanLoc l))) -> l -> f l Source #

Instances

Instances details
SpannedLens (Span l) Source # 
Instance details

Defined in Text.Loc

Methods

lSpan :: Functor f => (Span (SpanLoc (Span l)) -> f (Span (SpanLoc (Span l)))) -> Span l -> f (Span l) Source #

SpannedLens l => SpannedLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lSpan :: Functor f => (Span (SpanLoc (InSrc s l)) -> f (Span (SpanLoc (InSrc s l)))) -> InSrc s l -> f (InSrc s l) Source #

SpannedLens l => SpannedLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lSpan :: Functor f => (Span (SpanLoc (Nested l p)) -> f (Span (SpanLoc (Nested l p)))) -> Nested l p -> f (Nested l p) 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.

data Located l α Source #

A simple way to attach location to a value.

Constructors

Located 

Fields

Instances

Instances details
Foldable (Located l) Source # 
Instance details

Defined in Text.Loc

Methods

fold :: Monoid m => Located l m -> m #

foldMap :: Monoid m => (a -> m) -> Located l a -> m #

foldMap' :: Monoid m => (a -> m) -> Located l a -> m #

foldr :: (a -> b -> b) -> b -> Located l a -> b #

foldr' :: (a -> b -> b) -> b -> Located l a -> b #

foldl :: (b -> a -> b) -> b -> Located l a -> b #

foldl' :: (b -> a -> b) -> b -> Located l a -> b #

foldr1 :: (a -> a -> a) -> Located l a -> a #

foldl1 :: (a -> a -> a) -> Located l a -> a #

toList :: Located l a -> [a] #

null :: Located l a -> Bool #

length :: Located l a -> Int #

elem :: Eq a => a -> Located l a -> Bool #

maximum :: Ord a => Located l a -> a #

minimum :: Ord a => Located l a -> a #

sum :: Num a => Located l a -> a #

product :: Num a => Located l a -> a #

Traversable (Located l) Source # 
Instance details

Defined in Text.Loc

Methods

traverse :: Applicative f => (a -> f b) -> Located l a -> f (Located l b) #

sequenceA :: Applicative f => Located l (f a) -> f (Located l a) #

mapM :: Monad m => (a -> m b) -> Located l a -> m (Located l b) #

sequence :: Monad m => Located l (m a) -> m (Located l a) #

Functor (Located l) Source # 
Instance details

Defined in Text.Loc

Methods

fmap :: (a -> b) -> Located l a -> Located l b #

(<$) :: a -> Located l b -> Located l a #

Generic (Located l α) Source # 
Instance details

Defined in Text.Loc

Associated Types

type Rep (Located l α) :: Type -> Type #

Methods

from :: Located l α -> Rep (Located l α) x #

to :: Rep (Located l α) x -> Located l α #

(Read l, Read α) => Read (Located l α) Source # 
Instance details

Defined in Text.Loc

(Show l, Show α) => Show (Located l α) Source # 
Instance details

Defined in Text.Loc

Methods

showsPrec :: Int -> Located l α -> ShowS #

show :: Located l α -> String #

showList :: [Located l α] -> ShowS #

(Eq l, Eq α) => Eq (Located l α) Source # 
Instance details

Defined in Text.Loc

Methods

(==) :: Located l α -> Located l α -> Bool #

(/=) :: Located l α -> Located l α -> Bool #

(Hashable l, Hashable α) => Hashable (Located l α) Source # 
Instance details

Defined in Text.Loc

Methods

hashWithSalt :: Int -> Located l α -> Int #

hash :: Located l α -> Int #

HasLoc (Located l α) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (Located l α) Source #

Methods

locOf :: Located l α -> LocOf (Located l α) Source #

LocLens (Located l α) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (Located l α) -> f (LocOf (Located l α))) -> Located l α -> f (Located l α) Source #

type Rep (Located l α) Source # 
Instance details

Defined in Text.Loc

type Rep (Located l α) = D1 ('MetaData "Located" "Text.Loc" "text-loc-0.1.1-GlWx6SfF9Kx4Cq6FohOQm8" 'False) (C1 ('MetaCons "Located" 'PrefixI 'True) (S1 ('MetaSel ('Just "locAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 l) :*: S1 ('MetaSel ('Just "locVal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 α)))
type LocOf (Located l α) Source # 
Instance details

Defined in Text.Loc

type LocOf (Located l α) = l

data LineCol Source #

Line-column location within a text.

Constructors

LineCol !Word !Word 

Instances

Instances details
Bounded LineCol Source # 
Instance details

Defined in Text.Loc

Generic LineCol Source # 
Instance details

Defined in Text.Loc

Associated Types

type Rep LineCol :: Type -> Type #

Methods

from :: LineCol -> Rep LineCol x #

to :: Rep LineCol x -> LineCol #

Read LineCol Source # 
Instance details

Defined in Text.Loc

Show LineCol Source # 
Instance details

Defined in Text.Loc

Eq LineCol Source # 
Instance details

Defined in Text.Loc

Methods

(==) :: LineCol -> LineCol -> Bool #

(/=) :: LineCol -> LineCol -> Bool #

Ord LineCol Source # 
Instance details

Defined in Text.Loc

Hashable LineCol Source # 
Instance details

Defined in Text.Loc

Methods

hashWithSalt :: Int -> LineCol -> Int #

hash :: LineCol -> Int #

HasLoc LineCol Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf LineCol Source #

LineColLens LineCol Source # 
Instance details

Defined in Text.Loc

Methods

lLineCol :: Functor f => (LineCol -> f LineCol) -> LineCol -> f LineCol Source #

LineColLoc LineCol Source # 
Instance details

Defined in Text.Loc

type Rep LineCol Source # 
Instance details

Defined in Text.Loc

type Rep LineCol = D1 ('MetaData "LineCol" "Text.Loc" "text-loc-0.1.1-GlWx6SfF9Kx4Cq6FohOQm8" 'False) (C1 ('MetaCons "LineCol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word)))
type LocOf LineCol Source # 
Instance details

Defined in Text.Loc

nextLine :: LineCol -> LineCol Source #

The location of the start of the next line.

nextCol :: LineCol -> LineCol Source #

The location of the next column.

class LineColLoc l where Source #

Locations with line and column numbers.

Methods

locLineCol :: l -> LineCol Source #

Instances

Instances details
LineColLoc LineCol Source # 
Instance details

Defined in Text.Loc

LineColLoc l => LineColLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

locLineCol :: InSrc s l -> LineCol Source #

LineColLoc l => LineColLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

locLineCol :: Nested l p -> LineCol 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.

Methods

lLineCol :: Functor f => (LineCol -> f LineCol) -> l -> f l Source #

Instances

Instances details
LineColLens LineCol Source # 
Instance details

Defined in Text.Loc

Methods

lLineCol :: Functor f => (LineCol -> f LineCol) -> LineCol -> f LineCol Source #

LineColLens l => LineColLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lLineCol :: Functor f => (LineCol -> f LineCol) -> InSrc s l -> f (InSrc s l) Source #

LineColLens l => LineColLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lLineCol :: Functor f => (LineCol -> f LineCol) -> Nested l p -> f (Nested l p) 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.

class SrcLoc l where Source #

Locations with a source (e.g. file name).

Associated Types

type LocSrc l Source #

Methods

locSrc :: l -> LocSrc l Source #

Instances

Instances details
SrcLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocSrc (InSrc s l) Source #

Methods

locSrc :: InSrc s l -> LocSrc (InSrc s l) Source #

SrcLoc l => SrcLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocSrc (Nested l p) Source #

Methods

locSrc :: Nested l p -> LocSrc (Nested l p) Source #

srcOf :: (HasLoc α, SrcLoc (LocOf α)) => α -> LocSrc (LocOf α) Source #

The source of the associated location.

class SrcLoc l => SrcLens l where Source #

Locations with editable source (e.g. file name).

Methods

lSrc :: Functor f => (LocSrc l -> f (LocSrc l)) -> l -> f l Source #

Instances

Instances details
SrcLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lSrc :: Functor f => (LocSrc (InSrc s l) -> f (LocSrc (InSrc s l))) -> InSrc s l -> f (InSrc s l) Source #

SrcLens l => SrcLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lSrc :: Functor f => (LocSrc (Nested l p) -> f (LocSrc (Nested l p))) -> Nested l p -> f (Nested l p) Source #

lSrcOf :: (Functor f, LocLens α, SrcLens (LocOf α)) => (LocSrc (LocOf α) -> f (LocSrc (LocOf α))) -> α -> f α Source #

Provides access to the source of the associated location.

data InSrc s l Source #

A simple way to add source to a location.

Constructors

InSrc 

Fields

Instances

Instances details
Generic (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type Rep (InSrc s l) :: Type -> Type #

Methods

from :: InSrc s l -> Rep (InSrc s l) x #

to :: Rep (InSrc s l) x -> InSrc s l #

(Read s, Read l) => Read (InSrc s l) Source # 
Instance details

Defined in Text.Loc

(Show s, Show l) => Show (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

showsPrec :: Int -> InSrc s l -> ShowS #

show :: InSrc s l -> String #

showList :: [InSrc s l] -> ShowS #

(Eq s, Eq l) => Eq (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

(==) :: InSrc s l -> InSrc s l -> Bool #

(/=) :: InSrc s l -> InSrc s l -> Bool #

(Ord s, Ord l) => Ord (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

compare :: InSrc s l -> InSrc s l -> Ordering #

(<) :: InSrc s l -> InSrc s l -> Bool #

(<=) :: InSrc s l -> InSrc s l -> Bool #

(>) :: InSrc s l -> InSrc s l -> Bool #

(>=) :: InSrc s l -> InSrc s l -> Bool #

max :: InSrc s l -> InSrc s l -> InSrc s l #

min :: InSrc s l -> InSrc s l -> InSrc s l #

(Hashable s, Hashable l) => Hashable (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

hashWithSalt :: Int -> InSrc s l -> Int #

hash :: InSrc s l -> Int #

FromLens l => FromLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lFrom :: Functor f => (LocFrom (InSrc s l) -> f (LocFrom (InSrc s l))) -> InSrc s l -> f (InSrc s l) Source #

FromLoc l => FromLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocFrom (InSrc s l) Source #

Methods

locFrom :: InSrc s l -> LocFrom (InSrc s l) Source #

HasLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (InSrc s l) Source #

Methods

locOf :: InSrc s l -> LocOf (InSrc s l) Source #

LineColLens l => LineColLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lLineCol :: Functor f => (LineCol -> f LineCol) -> InSrc s l -> f (InSrc s l) Source #

LineColLoc l => LineColLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

locLineCol :: InSrc s l -> LineCol Source #

LocLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (InSrc s l) -> f (LocOf (InSrc s l))) -> InSrc s l -> f (InSrc s l) Source #

SpannedLens l => SpannedLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lSpan :: Functor f => (Span (SpanLoc (InSrc s l)) -> f (Span (SpanLoc (InSrc s l)))) -> InSrc s l -> f (InSrc s l) Source #

SpannedLoc l => SpannedLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type SpanLoc (InSrc s l) Source #

Methods

locSpan :: InSrc s l -> Span (SpanLoc (InSrc s l)) Source #

SrcLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lSrc :: Functor f => (LocSrc (InSrc s l) -> f (LocSrc (InSrc s l))) -> InSrc s l -> f (InSrc s l) Source #

SrcLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocSrc (InSrc s l) Source #

Methods

locSrc :: InSrc s l -> LocSrc (InSrc s l) Source #

type Rep (InSrc s l) Source # 
Instance details

Defined in Text.Loc

type Rep (InSrc s l) = D1 ('MetaData "InSrc" "Text.Loc" "text-loc-0.1.1-GlWx6SfF9Kx4Cq6FohOQm8" 'False) (C1 ('MetaCons "InSrc" 'PrefixI 'True) (S1 ('MetaSel ('Just "srcSrc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 s) :*: S1 ('MetaSel ('Just "srcLoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 l)))
type LocFrom (InSrc s l) Source # 
Instance details

Defined in Text.Loc

type LocFrom (InSrc s l) = LocFrom l
type LocOf (InSrc s l) Source # 
Instance details

Defined in Text.Loc

type LocOf (InSrc s l) = InSrc s l
type LocSrc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

type LocSrc (InSrc s l) = s
type SpanLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

type SpanLoc (InSrc s l) = InSrc s (SpanLoc l)

class FromLoc l where Source #

Locations that have parent locations.

Associated Types

type LocFrom l Source #

Methods

locFrom :: l -> LocFrom l Source #

Instances

Instances details
FromLoc l => FromLoc (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocFrom (InSrc s l) Source #

Methods

locFrom :: InSrc s l -> LocFrom (InSrc s l) Source #

FromLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocFrom (Nested l p) Source #

Methods

locFrom :: Nested l p -> LocFrom (Nested l p) Source #

fromOf :: (HasLoc α, FromLoc (LocOf α)) => α -> LocFrom (LocOf α) Source #

The parent of the associated location.

class FromLoc l => FromLens l where Source #

Locations with editable parent locations.

Methods

lFrom :: Functor f => (LocFrom l -> f (LocFrom l)) -> l -> f l Source #

Instances

Instances details
FromLens l => FromLens (InSrc s l) Source # 
Instance details

Defined in Text.Loc

Methods

lFrom :: Functor f => (LocFrom (InSrc s l) -> f (LocFrom (InSrc s l))) -> InSrc s l -> f (InSrc s l) Source #

FromLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lFrom :: Functor f => (LocFrom (Nested l p) -> f (LocFrom (Nested l p))) -> Nested l p -> f (Nested l p) Source #

lFromOf :: (Functor f, LocLens α, FromLens (LocOf α)) => (LocFrom (LocOf α) -> f (LocFrom (LocOf α))) -> α -> f α Source #

Provides access to the parent of the associated location.

data Nested l p Source #

A simple way to nest a location.

Constructors

Nested 

Fields

Instances

Instances details
Generic (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type Rep (Nested l p) :: Type -> Type #

Methods

from :: Nested l p -> Rep (Nested l p) x #

to :: Rep (Nested l p) x -> Nested l p #

(Read l, Read p) => Read (Nested l p) Source # 
Instance details

Defined in Text.Loc

(Show l, Show p) => Show (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

showsPrec :: Int -> Nested l p -> ShowS #

show :: Nested l p -> String #

showList :: [Nested l p] -> ShowS #

(Eq l, Eq p) => Eq (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

(==) :: Nested l p -> Nested l p -> Bool #

(/=) :: Nested l p -> Nested l p -> Bool #

(Hashable l, Hashable p) => Hashable (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

hashWithSalt :: Int -> Nested l p -> Int #

hash :: Nested l p -> Int #

FromLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lFrom :: Functor f => (LocFrom (Nested l p) -> f (LocFrom (Nested l p))) -> Nested l p -> f (Nested l p) Source #

FromLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocFrom (Nested l p) Source #

Methods

locFrom :: Nested l p -> LocFrom (Nested l p) Source #

HasLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocOf (Nested l p) Source #

Methods

locOf :: Nested l p -> LocOf (Nested l p) Source #

LineColLens l => LineColLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lLineCol :: Functor f => (LineCol -> f LineCol) -> Nested l p -> f (Nested l p) Source #

LineColLoc l => LineColLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

locLineCol :: Nested l p -> LineCol Source #

LocLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lLocOf :: Functor f => (LocOf (Nested l p) -> f (LocOf (Nested l p))) -> Nested l p -> f (Nested l p) Source #

SpannedLens l => SpannedLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lSpan :: Functor f => (Span (SpanLoc (Nested l p)) -> f (Span (SpanLoc (Nested l p)))) -> Nested l p -> f (Nested l p) Source #

SpannedLoc l => SpannedLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type SpanLoc (Nested l p) Source #

Methods

locSpan :: Nested l p -> Span (SpanLoc (Nested l p)) Source #

SrcLens l => SrcLens (Nested l p) Source # 
Instance details

Defined in Text.Loc

Methods

lSrc :: Functor f => (LocSrc (Nested l p) -> f (LocSrc (Nested l p))) -> Nested l p -> f (Nested l p) Source #

SrcLoc l => SrcLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

Associated Types

type LocSrc (Nested l p) Source #

Methods

locSrc :: Nested l p -> LocSrc (Nested l p) Source #

type Rep (Nested l p) Source # 
Instance details

Defined in Text.Loc

type Rep (Nested l p) = D1 ('MetaData "Nested" "Text.Loc" "text-loc-0.1.1-GlWx6SfF9Kx4Cq6FohOQm8" 'False) (C1 ('MetaCons "Nested" 'PrefixI 'True) (S1 ('MetaSel ('Just "nestedLoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 l) :*: S1 ('MetaSel ('Just "nestedFrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 p)))
type LocFrom (Nested l p) Source # 
Instance details

Defined in Text.Loc

type LocFrom (Nested l p) = p
type LocOf (Nested l p) Source # 
Instance details

Defined in Text.Loc

type LocOf (Nested l p) = Nested l p
type LocSrc (Nested l p) Source # 
Instance details

Defined in Text.Loc

type LocSrc (Nested l p) = LocSrc l
type SpanLoc (Nested l p) Source # 
Instance details

Defined in Text.Loc

type SpanLoc (Nested l p) = Nested (SpanLoc l) p