Convert a literal from one index type to another. The constraint XXLit (GhcPass p)~DataConCantHappen means that once the XLit constructor is inhabited, we can no longer go back to the case where its not. In practice it just means you can't just convertLit to go from (HsLit GhcTc) -> (HsLit GhcPs/GhcRn), while all other conversions are fine.
Moduleghc-10.0.0.20260917GHC2024
GHC.Hs.Lit
Source-language literals
- 3 types
- 7 values
- Packageghc-10.0.0.20260917
- Exports10
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceLit.hs
module Language.Haskell.Syntax.Lit
hsLitNeedsParens p l returns True if a literal l needs
to be parenthesized under precedence p.
See Note [Printing of literals in Core] in GHC.Types.Literal for the reasoning.
hsOverLitNeedsParens p ol returns True if an overloaded literal
ol needs to be parenthesized under precedence p.
Constructors
HsInteger SourceText Integer TypeGenuinely an integer; arises only from TRANSLATION (overloaded literals are done with HsOverLit)
HsRat FractionalLit TypeGenuinely a rational; arises only from TRANSLATION (overloaded literals are done with HsOverLit)
Constructors
Constructors
Orphan instances
7 instancesOutputable OverLitValOutputable QualLitValEq (XXOverLit p) => Eq (HsOverLit p)Ord (XXOverLit p) => Ord (HsOverLit p)IsPass p => Outputable (HsLit (GhcPass p))OutputableBndrId p => Outputable (HsOverLit (GhcPass p))OutputableBndrId p => Outputable (HsQualLit (GhcPass p))