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

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

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Types.SourceText

Source text

Keeping Source Text for source to source conversions

  • 5 types
  • 10 values
datadata SourceText
#

Constructors

Instances8Eq, Data, Show, NFData, Outputable, Binary, …

Literals

13 declarations
datadata IntegralLit
#

Integral Literal

Used (instead of Integer) to represent negative zegative zero which is required for NegativeLiterals extension to correctly parse `-0::Double` as negative zero. See also #13211.

Instances5Eq, Data, Ord, Show, Outputable
  • Eq IntegralLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
  • Data IntegralLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
  • Ord IntegralLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
  • Show IntegralLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
  • Outputable IntegralLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
datadata FractionalLit
#

Fractional Literal

Used (instead of Rational) to represent exactly the floating point literal that we encountered in the user's source program. This allows us to pretty-print exactly what the user wrote, which is important e.g. for floating point numbers that can't represented as Doubles (we used to via Double for pretty-printing). See also #2245. Note [FractionalLit representation] in GHC.HsToCore.Match.Literal The actual value then is: sign * fl_signi * (fl_exp_base^fl_exp) where sign = if fl_neg then (-1) else 1

For example FL { fl_neg = True, fl_signi = 5.3, fl_exp = 4, fl_exp_base = Base10 } denotes -5300

Constructors

Instances5Eq, Data, Ord, Show, Outputable
  • Eq FractionalLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText

    Be wary of using this instance to compare for equal *values* when exponents are large. The same value expressed in different syntactic form won't compare as equal when any of the exponents is >= 100.

  • Data FractionalLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
  • Ord FractionalLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText

    Be wary of using this instance to compare for equal *values* when exponents are large. The same value expressed in different syntactic form won't compare as equal when any of the exponents is >= 100.

  • Show FractionalLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
  • Outputable FractionalLitDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SourceText
datadata StringLiteral
#

A String Literal in the source, including its original raw format for use by source to source manipulation tools.

Instances4Eq, Data, Outputable, Anno