Language.Haskell.Syntax.Lit

ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

Language.Haskell.Syntax.Lit

Description

Source-language literals

Synopsis

- data HsLit x
  - = HsChar (XHsChar x) Char
  - | HsCharPrim (XHsCharPrim x) Char
  - | HsString (XHsString x) FastString
  - | HsMultilineString (XHsMultilineString x) FastString
  - | HsStringPrim (XHsStringPrim x) !ByteString
  - | HsInt (XHsInt x) IntegralLit
  - | HsIntPrim (XHsIntPrim x) Integer
  - | HsWordPrim (XHsWordPrim x) Integer
  - | HsInt8Prim (XHsInt8Prim x) Integer
  - | HsInt16Prim (XHsInt16Prim x) Integer
  - | HsInt32Prim (XHsInt32Prim x) Integer
  - | HsInt64Prim (XHsInt64Prim x) Integer
  - | HsWord8Prim (XHsWord8Prim x) Integer
  - | HsWord16Prim (XHsWord16Prim x) Integer
  - | HsWord32Prim (XHsWord32Prim x) Integer
  - | HsWord64Prim (XHsWord64Prim x) Integer
  - | HsFloatPrim (XHsFloatPrim x) FractionalLit
  - | HsDoublePrim (XHsDoublePrim x) FractionalLit
  - | XLit !(XXLit x)
- data HsOverLit p
  - = OverLit {
    - ol_ext :: XOverLit p
    - ol_val :: OverLitVal
    }
  - | XOverLit !(XXOverLit p)
- data OverLitVal
  - = HsIntegral !IntegralLit
  - | HsFractional !FractionalLit
  - | HsIsString !SourceText !FastString

# Documentation

data HsLit x #

Haskell Literal

Constructors

HsChar (XHsChar x) Char | Character
HsCharPrim (XHsCharPrim x) Char | Unboxed character
HsString (XHsString x) FastString | String
HsMultilineString (XHsMultilineString x) FastString | String
HsStringPrim (XHsStringPrim x) !ByteString | Packed bytes
HsInt (XHsInt x) IntegralLit | Genuinely an Int; arises from GHC.Tc.Deriv.Generate, and from TRANSLATION
HsIntPrim (XHsIntPrim x) Integer | literal `Int#`
HsWordPrim (XHsWordPrim x) Integer | literal `Word#`
HsInt8Prim (XHsInt8Prim x) Integer | literal `Int8#`
HsInt16Prim (XHsInt16Prim x) Integer | literal `Int16#`
HsInt32Prim (XHsInt32Prim x) Integer | literal `Int32#`
HsInt64Prim (XHsInt64Prim x) Integer | literal `Int64#`
HsWord8Prim (XHsWord8Prim x) Integer | literal `Word8#`
HsWord16Prim (XHsWord16Prim x) Integer | literal `Word16#`
HsWord32Prim (XHsWord32Prim x) Integer | literal `Word32#`
HsWord64Prim (XHsWord64Prim x) Integer | literal `Word64#`
HsFloatPrim (XHsFloatPrim x) FractionalLit | Unboxed Float
HsDoublePrim (XHsDoublePrim x) FractionalLit | Unboxed Double
XLit !(XXLit x) |

#### Instances

Instances details

Data (HsLit GhcPs) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsLit GhcPs -> c (HsLit GhcPs) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsLit GhcPs) # toConstr :: HsLit GhcPs -> Constr # dataTypeOf :: HsLit GhcPs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsLit GhcPs)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsLit GhcPs)) # gmapT :: (forall b. Data b => b -> b) -> HsLit GhcPs -> HsLit GhcPs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsLit GhcPs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsLit GhcPs -> r # gmapQ :: (forall d. Data d => d -> u) -> HsLit GhcPs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsLit GhcPs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsLit GhcPs -> m (HsLit GhcPs) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit GhcPs -> m (HsLit GhcPs) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit GhcPs -> m (HsLit GhcPs) #
Data (HsLit GhcRn) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsLit GhcRn -> c (HsLit GhcRn) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsLit GhcRn) # toConstr :: HsLit GhcRn -> Constr # dataTypeOf :: HsLit GhcRn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsLit GhcRn)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsLit GhcRn)) # gmapT :: (forall b. Data b => b -> b) -> HsLit GhcRn -> HsLit GhcRn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsLit GhcRn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsLit GhcRn -> r # gmapQ :: (forall d. Data d => d -> u) -> HsLit GhcRn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsLit GhcRn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsLit GhcRn -> m (HsLit GhcRn) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit GhcRn -> m (HsLit GhcRn) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit GhcRn -> m (HsLit GhcRn) #
Data (HsLit GhcTc) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsLit GhcTc -> c (HsLit GhcTc) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsLit GhcTc) # toConstr :: HsLit GhcTc -> Constr # dataTypeOf :: HsLit GhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsLit GhcTc)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsLit GhcTc)) # gmapT :: (forall b. Data b => b -> b) -> HsLit GhcTc -> HsLit GhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsLit GhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsLit GhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> HsLit GhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsLit GhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsLit GhcTc -> m (HsLit GhcTc) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit GhcTc -> m (HsLit GhcTc) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit GhcTc -> m (HsLit GhcTc) #
IsPass p => Outputable (HsLit (GhcPass p)) # |
Instance details Defined in GHC.Hs.Lit Methods ppr :: HsLit (GhcPass p) -> SDoc #
Eq (XXLit x) => Eq (HsLit x) # |
Instance details Defined in Language.Haskell.Syntax.Lit Methods (==) :: HsLit x -> HsLit x -> Bool # (/=) :: HsLit x -> HsLit x -> Bool #

data HsOverLit p #

Haskell Overloaded Literal

Constructors

OverLit |
Fields ol_ext :: XOverLit p ol_val :: OverLitVal
XOverLit !(XXOverLit p) |

#### Instances

Instances details

Data (HsOverLit GhcPs) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsOverLit GhcPs -> c (HsOverLit GhcPs) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsOverLit GhcPs) # toConstr :: HsOverLit GhcPs -> Constr # dataTypeOf :: HsOverLit GhcPs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsOverLit GhcPs)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsOverLit GhcPs)) # gmapT :: (forall b. Data b => b -> b) -> HsOverLit GhcPs -> HsOverLit GhcPs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit GhcPs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit GhcPs -> r # gmapQ :: (forall d. Data d => d -> u) -> HsOverLit GhcPs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsOverLit GhcPs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsOverLit GhcPs -> m (HsOverLit GhcPs) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit GhcPs -> m (HsOverLit GhcPs) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit GhcPs -> m (HsOverLit GhcPs) #
Data (HsOverLit GhcRn) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsOverLit GhcRn -> c (HsOverLit GhcRn) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsOverLit GhcRn) # toConstr :: HsOverLit GhcRn -> Constr # dataTypeOf :: HsOverLit GhcRn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsOverLit GhcRn)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsOverLit GhcRn)) # gmapT :: (forall b. Data b => b -> b) -> HsOverLit GhcRn -> HsOverLit GhcRn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit GhcRn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit GhcRn -> r # gmapQ :: (forall d. Data d => d -> u) -> HsOverLit GhcRn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsOverLit GhcRn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsOverLit GhcRn -> m (HsOverLit GhcRn) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit GhcRn -> m (HsOverLit GhcRn) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit GhcRn -> m (HsOverLit GhcRn) #
Data (HsOverLit GhcTc) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsOverLit GhcTc -> c (HsOverLit GhcTc) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsOverLit GhcTc) # toConstr :: HsOverLit GhcTc -> Constr # dataTypeOf :: HsOverLit GhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsOverLit GhcTc)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsOverLit GhcTc)) # gmapT :: (forall b. Data b => b -> b) -> HsOverLit GhcTc -> HsOverLit GhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit GhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit GhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> HsOverLit GhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsOverLit GhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsOverLit GhcTc -> m (HsOverLit GhcTc) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit GhcTc -> m (HsOverLit GhcTc) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit GhcTc -> m (HsOverLit GhcTc) #
OutputableBndrId p => Outputable (HsOverLit (GhcPass p)) # |
Instance details Defined in GHC.Hs.Lit Methods ppr :: HsOverLit (GhcPass p) -> SDoc #
Eq (XXOverLit p) => Eq (HsOverLit p) # |
Instance details Defined in GHC.Hs.Lit Methods (==) :: HsOverLit p -> HsOverLit p -> Bool # (/=) :: HsOverLit p -> HsOverLit p -> Bool #
Ord (XXOverLit p) => Ord (HsOverLit p) # |
Instance details Defined in GHC.Hs.Lit Methods compare :: HsOverLit p -> HsOverLit p -> Ordering # (<) :: HsOverLit p -> HsOverLit p -> Bool # (<=) :: HsOverLit p -> HsOverLit p -> Bool # (>) :: HsOverLit p -> HsOverLit p -> Bool # (>=) :: HsOverLit p -> HsOverLit p -> Bool # max :: HsOverLit p -> HsOverLit p -> HsOverLit p # min :: HsOverLit p -> HsOverLit p -> HsOverLit p #
type Anno (HsOverLit (GhcPass p)) # |
Instance details Defined in GHC.Hs.Pat type Anno (HsOverLit (GhcPass p)) = EpAnnCO

data OverLitVal #

Overloaded Literal Value

Constructors

HsIntegral !IntegralLit | Integer-looking literals;
HsFractional !FractionalLit | Frac-looking literals
HsIsString !SourceText !FastString | String-looking literals

#### Instances

Instances details

Data OverLitVal # |
Instance details Defined in Language.Haskell.Syntax.Lit Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OverLitVal -> c OverLitVal # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OverLitVal # toConstr :: OverLitVal -> Constr # dataTypeOf :: OverLitVal -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OverLitVal) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OverLitVal) # gmapT :: (forall b. Data b => b -> b) -> OverLitVal -> OverLitVal # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OverLitVal -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OverLitVal -> r # gmapQ :: (forall d. Data d => d -> u) -> OverLitVal -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OverLitVal -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OverLitVal -> m OverLitVal # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OverLitVal -> m OverLitVal # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OverLitVal -> m OverLitVal #
Outputable OverLitVal # |
Instance details Defined in GHC.Hs.Lit Methods ppr :: OverLitVal -> SDoc #
Eq OverLitVal # |
Instance details Defined in Language.Haskell.Syntax.Lit Methods (==) :: OverLitVal -> OverLitVal -> Bool # (/=) :: OverLitVal -> OverLitVal -> Bool #
Ord OverLitVal # |
Instance details Defined in Language.Haskell.Syntax.Lit Methods compare :: OverLitVal -> OverLitVal -> Ordering # (<) :: OverLitVal -> OverLitVal -> Bool # (<=) :: OverLitVal -> OverLitVal -> Bool # (>) :: OverLitVal -> OverLitVal -> Bool # (>=) :: OverLitVal -> OverLitVal -> Bool # max :: OverLitVal -> OverLitVal -> OverLitVal # min :: OverLitVal -> OverLitVal -> OverLitVal #