| |||||||||||||||||||||||
| |||||||||||||||||||||||
| |||||||||||||||||||||||
Synopsis | |||||||||||||||||||||||
Main data type | |||||||||||||||||||||||
data Literal | |||||||||||||||||||||||
| |||||||||||||||||||||||
Creating Literals | |||||||||||||||||||||||
mkMachInt :: Integer -> Literal | |||||||||||||||||||||||
Creates a Literal of type Int# | |||||||||||||||||||||||
mkMachWord :: Integer -> Literal | |||||||||||||||||||||||
Creates a Literal of type Word# | |||||||||||||||||||||||
mkMachInt64 :: Integer -> Literal | |||||||||||||||||||||||
Creates a Literal of type Int64# | |||||||||||||||||||||||
mkMachWord64 :: Integer -> Literal | |||||||||||||||||||||||
Creates a Literal of type Word64# | |||||||||||||||||||||||
mkMachFloat :: Rational -> Literal | |||||||||||||||||||||||
Creates a Literal of type Float# | |||||||||||||||||||||||
mkMachDouble :: Rational -> Literal | |||||||||||||||||||||||
Creates a Literal of type Double# | |||||||||||||||||||||||
mkMachChar :: Char -> Literal | |||||||||||||||||||||||
Creates a Literal of type Char# | |||||||||||||||||||||||
mkMachString :: String -> Literal | |||||||||||||||||||||||
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 | |||||||||||||||||||||||
Operations on Literals | |||||||||||||||||||||||
literalType :: Literal -> Type | |||||||||||||||||||||||
Find the Haskell Type the literal occupies | |||||||||||||||||||||||
hashLiteral :: Literal -> Int | |||||||||||||||||||||||
Predicates on Literals and their contents | |||||||||||||||||||||||
litIsDupable :: Literal -> Bool | |||||||||||||||||||||||
True if code space does not go bad if we duplicate this literal Currently we treat it just like litIsTrivial | |||||||||||||||||||||||
litIsTrivial :: Literal -> Bool | |||||||||||||||||||||||
True if there is absolutely no penalty to duplicating the literal. False principally of strings | |||||||||||||||||||||||
inIntRange :: Integer -> Bool | |||||||||||||||||||||||
inWordRange :: Integer -> Bool | |||||||||||||||||||||||
tARGET_MAX_INT :: Integer | |||||||||||||||||||||||
inCharRange :: Char -> Bool | |||||||||||||||||||||||
isZeroLit :: Literal -> Bool | |||||||||||||||||||||||
Tests whether the literal represents a zero of whatever type it is | |||||||||||||||||||||||
litFitsInChar :: Literal -> Bool | |||||||||||||||||||||||
Coercions | |||||||||||||||||||||||
word2IntLit :: Literal -> Literal | |||||||||||||||||||||||
int2WordLit :: Literal -> Literal | |||||||||||||||||||||||
narrow8IntLit :: Literal -> Literal | |||||||||||||||||||||||
narrow16IntLit :: Literal -> Literal | |||||||||||||||||||||||
narrow32IntLit :: Literal -> Literal | |||||||||||||||||||||||
narrow8WordLit :: Literal -> Literal | |||||||||||||||||||||||
narrow16WordLit :: Literal -> Literal | |||||||||||||||||||||||
narrow32WordLit :: Literal -> Literal | |||||||||||||||||||||||
char2IntLit :: Literal -> Literal | |||||||||||||||||||||||
int2CharLit :: Literal -> Literal | |||||||||||||||||||||||
float2IntLit :: Literal -> Literal | |||||||||||||||||||||||
int2FloatLit :: Literal -> Literal | |||||||||||||||||||||||
double2IntLit :: Literal -> Literal | |||||||||||||||||||||||
int2DoubleLit :: Literal -> Literal | |||||||||||||||||||||||
nullAddrLit :: Literal | |||||||||||||||||||||||
float2DoubleLit :: Literal -> Literal | |||||||||||||||||||||||
double2FloatLit :: Literal -> Literal | |||||||||||||||||||||||
Produced by Haddock version 2.6.0 |