Copyright | (c) Wolfgang Lux |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module implements a data type for positions in a source file and respective functions to operate on them. A source file position consists of a filename, a line number, and a column number. A tab stop is assumed at every eighth column.
Synopsis
- class HasPosition a where
- getPosition :: a -> Position
- setPosition :: Position -> a -> a
- data Position
- (@>) :: (HasPosition a, HasPosition b) => a -> b -> a
- showPosition :: Position -> String
- ppPosition :: Position -> Doc
- ppLine :: Position -> Doc
- showLine :: Position -> String
- first :: FilePath -> Position
- next :: Position -> Position
- incr :: Position -> Int -> Position
- tab :: Position -> Position
- tabWidth :: Int
- nl :: Position -> Position
Source code position
class HasPosition a where Source #
Type class for entities which have a source code Position
Nothing
getPosition :: a -> Position Source #
Get the Position
setPosition :: Position -> a -> a Source #
Set the Position
Instances
Source code positions
(@>) :: (HasPosition a, HasPosition b) => a -> b -> a Source #
x @> y
returns x
with the position obtained from y