HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleparsec-3.1.18.0Haskell2010

Text.ParserCombinators.Parsec.Pos

Parsec compatibility module

  • 4 types
  • 12 values
  • Packageparsec-3.1.18.0
  • Exports16
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourcePos.hs
datadata SourcePos
#

The abstract data type SourcePos represents source positions. It contains the name of the source (i.e. file name), a line number and a column number. SourcePos is an instance of the Show, Eq and Ord class.

Instances4Eq, Data, Ord, Show

Update a source position given a character. If the character is a newline ('\n') or carriage return ('\r') the line number is incremented by 1. If the character is a tab ('t') the column number is incremented to the nearest 8'th column, ie. column + 8 - ((column-1) `mod` 8). In all other cases, the column is incremented by 1.