HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulemegaparsec-9.7.0Haskell2010

Text.Megaparsec.Pos

Textual source position. The position includes name of file, line number, and column number.

You probably do not want to import this module directly because Text.Megaparsec re-exports it anyway.

  • 3 types
  • 6 values
  • Packagemegaparsec-9.7.0
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourcePos.hs

Abstract position

6 declarations
newtypenewtype Pos
#

Pos is the type for positive integers. This is used to represent line number, column number, and similar things like indentation level. Semigroup instance can be used to safely and efficiently add Poses together.

Instances9Eq, Data, Ord, Read, Show, Generic, …
valuepos1 :: Pos
#

Position with value 1.

valuedefaultTabWidth :: Pos
#

Value of tab width used by default. Always prefer this constant when you want to refer to the default tab width because actual value may change in future.

Currently:

defaultTabWidth = mkPos 8
newtypenewtype InvalidPosException
#

The exception is thrown by mkPos when its argument is not a positive number.

Constructors

Instances7Eq, Data, Show, Generic, Exception, NFData, …

Source position

3 declarations
datadata SourcePos
#

The data type SourcePos represents source positions. It contains the name of the source file, a line number, and a column number. Source line and column positions change intensively during parsing, so we need to make them strict to avoid memory leaks.

Constructors

Instances8Eq, Data, Ord, Read, Show, Generic, …