HsLit

ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

HsLit

Synopsis

- data HsLit
  - = HsChar SourceText Char
  - | HsCharPrim SourceText Char
  - | HsString SourceText FastString
  - | HsStringPrim SourceText ByteString
  - | HsInt SourceText Integer
  - | HsIntPrim SourceText Integer
  - | HsWordPrim SourceText Integer
  - | HsInt64Prim SourceText Integer
  - | HsWord64Prim SourceText Integer
  - | HsInteger SourceText Integer Type
  - | HsRat FractionalLit Type
  - | HsFloatPrim FractionalLit
  - | HsDoublePrim FractionalLit
- data HsOverLit id = OverLit {
  - ol_val :: OverLitVal
  - ol_rebindable :: PostRn id Bool
  - ol_witness :: HsExpr id
  - ol_type :: PostTc id Type
  }
- data OverLitVal
  - = HsIntegral !SourceText !Integer
  - | HsFractional !FractionalLit
  - | HsIsString !SourceText !FastString
- overLitType :: HsOverLit a -> PostTc a Type
- pp_st_suffix :: SourceText -> SDoc -> SDoc -> SDoc
- pmPprHsLit :: HsLit -> SDoc

# Documentation

data HsLit Source #

Haskell Literal

Constructors

HsChar SourceText Char | Character
HsCharPrim SourceText Char | Unboxed character
HsString SourceText FastString | String
HsStringPrim SourceText ByteString | Packed bytes
HsInt SourceText Integer | Genuinely an Int; arises from `TcGenDeriv`, and from TRANSLATION
HsIntPrim SourceText Integer | literal `Int#`
HsWordPrim SourceText Integer | literal `Word#`
HsInt64Prim SourceText Integer | literal `Int64#`
HsWord64Prim SourceText Integer | literal `Word64#`
HsInteger SourceText Integer Type | Genuinely an integer; arises only from TRANSLATION (overloaded literals are done with HsOverLit)
HsRat FractionalLit Type | Genuinely a rational; arises only from TRANSLATION (overloaded literals are done with HsOverLit)
HsFloatPrim FractionalLit | Unboxed Float
HsDoublePrim FractionalLit | Unboxed Double

Instances

Eq HsLit # |
Methods (==) :: HsLit -> HsLit -> Bool # (/=) :: HsLit -> HsLit -> Bool #
Data HsLit # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsLit -> c HsLit Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsLit Source # toConstr :: HsLit -> Constr Source # dataTypeOf :: HsLit -> DataType Source # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c HsLit) Source # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsLit) Source # gmapT :: (forall b. Data b => b -> b) -> HsLit -> HsLit Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsLit -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsLit -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsLit -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsLit -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsLit -> m HsLit Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit -> m HsLit Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLit -> m HsLit Source #
Outputable HsLit # |
Methods ppr :: HsLit -> SDoc Source # pprPrec :: Rational -> HsLit -> SDoc Source #

data HsOverLit id Source #

Haskell Overloaded Literal

Constructors

OverLit |
Fields ol_val :: OverLitVal ol_rebindable :: PostRn id Bool ol_witness :: HsExpr id ol_type :: PostTc id Type

Instances

Eq (HsOverLit id) # |
Methods (==) :: HsOverLit id -> HsOverLit id -> Bool # (/=) :: HsOverLit id -> HsOverLit id -> Bool #
DataId id => Data (HsOverLit id) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsOverLit id -> c (HsOverLit id) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsOverLit id) Source # toConstr :: HsOverLit id -> Constr Source # dataTypeOf :: HsOverLit id -> DataType Source # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (HsOverLit id)) Source # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsOverLit id)) Source # gmapT :: (forall b. Data b => b -> b) -> HsOverLit id -> HsOverLit id Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit id -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsOverLit id -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsOverLit id -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsOverLit id -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsOverLit id -> m (HsOverLit id) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit id -> m (HsOverLit id) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsOverLit id -> m (HsOverLit id) Source #
Ord (HsOverLit id) # |
Methods compare :: HsOverLit id -> HsOverLit id -> Ordering # (<) :: HsOverLit id -> HsOverLit id -> Bool # (<=) :: HsOverLit id -> HsOverLit id -> Bool # (>) :: HsOverLit id -> HsOverLit id -> Bool # (>=) :: HsOverLit id -> HsOverLit id -> Bool # max :: HsOverLit id -> HsOverLit id -> HsOverLit id # min :: HsOverLit id -> HsOverLit id -> HsOverLit id #
OutputableBndrId id => Outputable (HsOverLit id) # |
Methods ppr :: HsOverLit id -> SDoc Source # pprPrec :: Rational -> HsOverLit id -> SDoc Source #

data OverLitVal Source #

Overloaded Literal Value

Constructors

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

Instances

Eq OverLitVal # |
Methods (==) :: OverLitVal -> OverLitVal -> Bool # (/=) :: OverLitVal -> OverLitVal -> Bool #
Data OverLitVal # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OverLitVal -> c OverLitVal Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OverLitVal Source # toConstr :: OverLitVal -> Constr Source # dataTypeOf :: OverLitVal -> DataType Source # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c OverLitVal) Source # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OverLitVal) Source # gmapT :: (forall b. Data b => b -> b) -> OverLitVal -> OverLitVal Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OverLitVal -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OverLitVal -> r Source # gmapQ :: (forall d. Data d => d -> u) -> OverLitVal -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> OverLitVal -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OverLitVal -> m OverLitVal Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OverLitVal -> m OverLitVal Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OverLitVal -> m OverLitVal Source #
Ord OverLitVal # |
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 #
Outputable OverLitVal # |
Methods ppr :: OverLitVal -> SDoc Source # pprPrec :: Rational -> OverLitVal -> SDoc Source #

overLitType :: HsOverLit a -> PostTc a Type Source #

pp_st_suffix :: SourceText -> SDoc -> SDoc -> SDoc Source #

pmPprHsLit :: HsLit -> 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