Safe Haskell | Safe-Infered |
---|
- data Literal
- mkMachInt :: Integer -> Literal
- mkMachWord :: Integer -> Literal
- mkMachInt64 :: Integer -> Literal
- mkMachWord64 :: Integer -> Literal
- mkMachFloat :: Rational -> Literal
- mkMachDouble :: Rational -> Literal
- mkMachChar :: Char -> Literal
- mkMachString :: String -> Literal
- mkLitInteger :: Integer -> Id -> Literal
- literalType :: Literal -> Type
- hashLiteral :: Literal -> Int
- absentLiteralOf :: TyCon -> Maybe Literal
- pprLiteral :: (SDoc -> SDoc) -> Literal -> SDoc
- litIsDupable :: Literal -> Bool
- litIsTrivial :: Literal -> Bool
- litIsLifted :: Literal -> Bool
- inIntRange, inWordRange :: Integer -> Bool
- tARGET_MAX_INT :: Integer
- inCharRange :: Char -> Bool
- isZeroLit :: Literal -> Bool
- litFitsInChar :: Literal -> Bool
- word2IntLit, double2FloatLit, float2DoubleLit, int2DoubleLit, double2IntLit, int2FloatLit, float2IntLit, int2CharLit, char2IntLit, narrow32WordLit, narrow16WordLit, narrow8WordLit, narrow32IntLit, narrow16IntLit, narrow8IntLit, int2WordLit :: Literal -> Literal
- nullAddrLit :: Literal
Main data type
So-called Literal
s are one of:
MachChar Char |
|
MachStr FastString | A string-literal: stored and emitted
UTF-8 encoded, we'll arrange to decode it
at runtime. Also emitted with a |
MachNullAddr | The |
MachInt Integer |
|
MachInt64 Integer |
|
MachWord Integer |
|
MachWord64 Integer |
|
MachFloat Rational |
|
MachDouble Rational |
|
MachLabel FastString (Maybe Int) FunctionOrData | A label literal. Parameters: 1) The name of the symbol mentioned in the declaration 2) The size (in bytes) of the arguments
the label expects. Only applicable with
|
LitInteger Integer Id |
Creating Literals
mkMachWord :: Integer -> LiteralSource
Creates a Literal
of type Word#
mkMachInt64 :: Integer -> LiteralSource
Creates a Literal
of type Int64#
mkMachWord64 :: Integer -> LiteralSource
Creates a Literal
of type Word64#
mkMachFloat :: Rational -> LiteralSource
Creates a Literal
of type Float#
mkMachDouble :: Rational -> LiteralSource
Creates a Literal
of type Double#
mkMachChar :: Char -> LiteralSource
Creates a Literal
of type Char#
mkMachString :: String -> LiteralSource
Creates a Literal
of type Addr#
, which is appropriate for passing to
e.g. some of the "error" functions in GHC.Err such as GHC.Err.runtimeError
mkLitInteger :: Integer -> Id -> LiteralSource
Operations on Literals
literalType :: Literal -> TypeSource
Find the Haskell Type
the literal occupies
hashLiteral :: Literal -> IntSource
Predicates on Literals and their contents
litIsDupable :: Literal -> BoolSource
True if code space does not go bad if we duplicate this literal
Currently we treat it just like litIsTrivial
litIsTrivial :: Literal -> BoolSource
True if there is absolutely no penalty to duplicating the literal. False principally of strings
litIsLifted :: Literal -> BoolSource
inIntRange, inWordRange :: Integer -> BoolSource
inCharRange :: Char -> BoolSource
isZeroLit :: Literal -> BoolSource
Tests whether the literal represents a zero of whatever type it is
litFitsInChar :: Literal -> BoolSource