HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulemegaparsec-9.5.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.

Contents
  1. Abstract position
  2. Source position
Synopsis
  • Packagemegaparsec-9.5.0
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourcePos.hs

Abstract position

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, …

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

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, …