HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Types.SourceText

Source text

Keeping Source Text for source to source conversions

  • 5 types
  • 10 values
  • Packageghc-9.10.3
  • Exports15
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceSourceText.hs
datadata SourceText
#

Constructors

Instances7Eq, 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
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-9.10.3 · 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-9.10.3 · GHC.Types.SourceText
  • Ord FractionalLitDefined in ghc-9.10.3 · 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-9.10.3 · GHC.Types.SourceText
  • Outputable FractionalLitDefined in ghc-9.10.3 · 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