loc-0.1.3.2: Types representing line and column positions and ranges in text files.

Safe HaskellNone
LanguageHaskell2010

Data.Loc.Loc

Contents

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

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,"")]