ghc-8.4.1: The GHC API

Safe HaskellNone
LanguageHaskell2010

HsLit

Synopsis

Documentation

data HsLit x Source #

Haskell Literal

Constructors

HsChar (XHsChar x) Char

Character

HsCharPrim (XHsCharPrim x) Char

Unboxed character

HsString (XHsString x) FastString

String

HsStringPrim (XHsStringPrim x) ByteString

Packed bytes

HsInt (XHsInt x) IntegralLit

Genuinely an Int; arises from TcGenDeriv, and from TRANSLATION

HsIntPrim (XHsIntPrim x) Integer

literal Int#

HsWordPrim (XHsWordPrim x) Integer

literal Word#

HsInt64Prim (XHsInt64Prim x) Integer

literal Int64#

HsWord64Prim (XHsWord64Prim x) Integer

literal Word64#

HsInteger (XHsInteger x) Integer Type

Genuinely an integer; arises only from TRANSLATION (overloaded literals are done with HsOverLit)

HsRat (XHsRat x) FractionalLit Type

Genuinely a rational; arises only from TRANSLATION (overloaded literals are done with HsOverLit)

HsFloatPrim (XHsFloatPrim x) FractionalLit

Unboxed Float

HsDoublePrim (XHsDoublePrim x) FractionalLit

Unboxed Double

Instances
Eq (HsLit x) Source # 
Instance details

Methods

(==) :: HsLit x -> HsLit x -> Bool #

(/=) :: HsLit x -> HsLit x -> Bool #

DataId x => Data (HsLit x) Source # 
Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsLit x -> c (HsLit x) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsLit x) #

toConstr :: HsLit x -> Constr #

dataTypeOf :: HsLit x -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsLit x)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsLit x)) #

gmapT :: (forall b. Data b => b -> b) -> HsLit x -> HsLit x #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsLit x -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsLit x -> r #

gmapQ :: (forall d. Data d => d -> u) -> HsLit x -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> HsLit x -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsLit x -> m (HsLit x) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit x -> m (HsLit x) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit x -> m (HsLit x) #

SourceTextX x => Outputable (HsLit x) Source # 
Instance details

Methods

ppr :: HsLit x -> SDoc Source #

pprPrec :: Rational -> HsLit x -> SDoc Source #

data HsOverLit p Source #

Haskell Overloaded Literal

Instances
Eq (HsOverLit p) Source # 
Instance details

Methods

(==) :: HsOverLit p -> HsOverLit p -> Bool #

(/=) :: HsOverLit p -> HsOverLit p -> Bool #

DataId p => Data (HsOverLit p) Source # 
Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsOverLit p -> c (HsOverLit p) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsOverLit p) #

toConstr :: HsOverLit p -> Constr #

dataTypeOf :: HsOverLit p -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsOverLit p)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsOverLit p)) #

gmapT :: (forall b. Data b => b -> b) -> HsOverLit p -> HsOverLit p #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit p -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit p -> r #

gmapQ :: (forall d. Data d => d -> u) -> HsOverLit p -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> HsOverLit p -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsOverLit p -> m (HsOverLit p) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit p -> m (HsOverLit p) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit p -> m (HsOverLit p) #

Ord (HsOverLit p) Source # 
Instance details
(SourceTextX p, OutputableBndrId p) => Outputable (HsOverLit p) Source # 
Instance details

data OverLitVal Source #

Overloaded Literal Value

Constructors

HsIntegral !IntegralLit

Integer-looking literals;

HsFractional !FractionalLit

Frac-looking literals

HsIsString !SourceText !FastString

String-looking literals

Instances
Eq OverLitVal Source # 
Instance details
Data OverLitVal Source # 
Instance details

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 :: (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 #

Ord OverLitVal Source # 
Instance details
Outputable OverLitVal Source # 
Instance details

convertLit :: ConvertIdX a b => HsLit a -> HsLit b Source #

Convert a literal from one index type to another, updating the annotations according to the relevant Convertable instance

pmPprHsLit :: SourceTextX x => HsLit x -> SDoc Source #

pmPprHsLit pretty prints literals and is used when pretty printing pattern match warnings. All are printed the same (i.e., without hashes if they are primitive and not wrapped in constructors if they are boxed). This happens mainly for too reasons: * We do not want to expose their internal representation * The warnings become too messy

isCompoundHsLit :: HsLit x -> Bool Source #

Returns True for compound literals that will need parentheses.

isCompoundHsOverLit :: HsOverLit x -> Bool Source #

Returns True for compound overloaded literals that will need parentheses when used in an argument position.