loc-0.1.3.16: Types representing line and column positions and ranges in text files.
Safe HaskellNone
LanguageHaskell2010

Data.Loc.Loc

Synopsis

Documentation

data Loc 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

Instances details
Eq Loc Source # 
Instance details

Defined in Data.Loc.Loc

Methods

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

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

Data Loc Source # 
Instance details

Defined in Data.Loc.Loc

Methods

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 #

toConstr :: Loc -> Constr #

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 #

Ord Loc Source # 
Instance details

Defined in Data.Loc.Loc

Methods

compare :: Loc -> Loc -> Ordering #

(<) :: Loc -> Loc -> Bool #

(<=) :: Loc -> Loc -> Bool #

(>) :: Loc -> Loc -> Bool #

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

max :: Loc -> Loc -> Loc #

min :: Loc -> Loc -> Loc #

Read Loc Source #

readPrec = locReadPrec

Instance details

Defined in Data.Loc.Loc

Show Loc Source #

showsPrec = locShowsPrec

Instance details

Defined in Data.Loc.Loc

Methods

showsPrec :: Int -> Loc -> ShowS #

show :: Loc -> String #

showList :: [Loc] -> ShowS #

Constructing

loc :: Line -> Column -> Loc Source #

Create a Loc from a line number and column number.

origin :: Loc Source #

The smallest location: loc 1 1.

>>> origin
1:1

Querying

Show and Read

locShowsPrec :: Int -> Loc -> ShowS Source #

>>> locShowsPrec minPrec (loc 3 14) ""
"3:14"

locReadPrec :: ReadPrec Loc Source #

>>> readPrec_to_S locReadPrec minPrec "3:14"
[(3:14,"")]