TysWiredIn

ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

TysWiredIn

Contents

- Helper functions defined here
- All wired in things
- Bool
- Ordering
- Boxing primitive types
- Char
- Double
- Float
- Int
- Word
- Word8
- List
- Maybe
- Tuples
  - Constraint tuples
- Any
- Sums
- Kinds
- Parallel arrays
- Equality predicates
- RuntimeRep and friends

Description

This module is about types that can be defined in Haskell, but which must be wired into the compiler nonetheless. C.f module TysPrim

Synopsis

- mkWiredInTyConName :: BuiltInSyntax -> Module -> FastString -> Unique -> TyCon -> Name
- mkWiredInIdName :: Module -> FastString -> Unique -> Id -> Name
- mkFunKind :: Kind -> Kind -> Kind
- mkForAllKind :: TyVar -> ArgFlag -> Kind -> Kind
- wiredInTyCons :: [TyCon]
- isBuiltInOcc_maybe :: OccName -> Maybe Name
- boolTy :: Type
- boolTyCon :: TyCon
- boolTyCon_RDR :: RdrName
- boolTyConName :: Name
- trueDataCon :: DataCon
- trueDataConId :: Id
- true_RDR :: RdrName
- falseDataCon :: DataCon
- falseDataConId :: Id
- false_RDR :: RdrName
- promotedFalseDataCon :: TyCon
- promotedTrueDataCon :: TyCon
- orderingTyCon :: TyCon
- ltDataCon :: DataCon
- ltDataConId :: Id
- eqDataCon :: DataCon
- eqDataConId :: Id
- gtDataCon :: DataCon
- gtDataConId :: Id
- promotedLTDataCon :: TyCon
- promotedEQDataCon :: TyCon
- promotedGTDataCon :: TyCon
- boxingDataCon_maybe :: TyCon -> Maybe DataCon
- charTyCon :: TyCon
- charDataCon :: DataCon
- charTyCon_RDR :: RdrName
- charTy :: Type
- stringTy :: Type
- charTyConName :: Name
- doubleTyCon :: TyCon
- doubleDataCon :: DataCon
- doubleTy :: Type
- doubleTyConName :: Name
- floatTyCon :: TyCon
- floatDataCon :: DataCon
- floatTy :: Type
- floatTyConName :: Name
- intTyCon :: TyCon
- intDataCon :: DataCon
- intTyCon_RDR :: RdrName
- intDataCon_RDR :: RdrName
- intTyConName :: Name
- intTy :: Type
- wordTyCon :: TyCon
- wordDataCon :: DataCon
- wordTyConName :: Name
- wordTy :: Type
- word8TyCon :: TyCon
- word8DataCon :: DataCon
- word8TyConName :: Name
- word8Ty :: Type
- listTyCon :: TyCon
- listTyCon_RDR :: RdrName
- listTyConName :: Name
- listTyConKey :: Unique
- nilDataCon :: DataCon
- nilDataConName :: Name
- nilDataConKey :: Unique
- consDataCon_RDR :: RdrName
- consDataCon :: DataCon
- consDataConName :: Name
- promotedNilDataCon :: TyCon
- promotedConsDataCon :: TyCon
- mkListTy :: Type -> Type
- mkPromotedListTy :: Kind -> [Type] -> Type
- maybeTyCon :: TyCon
- maybeTyConName :: Name
- nothingDataCon :: DataCon
- nothingDataConName :: Name
- promotedNothingDataCon :: TyCon
- justDataCon :: DataCon
- justDataConName :: Name
- promotedJustDataCon :: TyCon
- mkTupleTy :: Boxity -> [Type] -> Type
- mkBoxedTupleTy :: [Type] -> Type
- tupleTyCon :: Boxity -> Arity -> TyCon
- tupleDataCon :: Boxity -> Arity -> DataCon
- tupleTyConName :: TupleSort -> Arity -> Name
- promotedTupleDataCon :: Boxity -> Arity -> TyCon
- unitTyCon :: TyCon
- unitDataCon :: DataCon
- unitDataConId :: Id
- unitTy :: Type
- unitTyConKey :: Unique
- pairTyCon :: TyCon
- unboxedUnitTyCon :: TyCon
- unboxedUnitDataCon :: DataCon
- unboxedTupleKind :: [Type] -> Kind
- unboxedSumKind :: [Type] -> Kind
- cTupleTyConName :: Arity -> Name
- cTupleTyConNames :: [Name]
- isCTupleTyConName :: Name -> Bool
- cTupleDataConName :: Arity -> Name
- cTupleDataConNames :: [Name]
- anyTyCon :: TyCon
- anyTy :: Type
- anyTypeOfKind :: Kind -> Type
- mkSumTy :: [Type] -> Type
- sumTyCon :: Arity -> TyCon
- sumDataCon :: ConTag -> Arity -> DataCon
- typeNatKindCon :: TyCon
- typeNatKind :: Kind
- typeSymbolKindCon :: TyCon
- typeSymbolKind :: Kind
- isLiftedTypeKindTyConName :: Name -> Bool
- liftedTypeKind :: Kind
- constraintKind :: Kind
- starKindTyCon :: TyCon
- starKindTyConName :: Name
- unicodeStarKindTyCon :: TyCon
- unicodeStarKindTyConName :: Name
- liftedTypeKindTyCon :: TyCon
- constraintKindTyCon :: TyCon
- mkPArrTy :: Type -> Type
- parrTyCon :: TyCon
- parrFakeCon :: Arity -> DataCon
- isPArrTyCon :: TyCon -> Bool
- isPArrFakeCon :: DataCon -> Bool
- parrTyCon_RDR :: RdrName
- parrTyConName :: Name
- heqTyCon :: TyCon
- heqClass :: Class
- heqDataCon :: DataCon
- coercibleTyCon :: TyCon
- coercibleDataCon :: DataCon
- coercibleClass :: Class
- runtimeRepTyCon :: TyCon
- vecCountTyCon :: TyCon
- vecElemTyCon :: TyCon
- runtimeRepTy :: Type
- liftedRepTy :: Type
- liftedRepDataCon :: DataCon
- liftedRepDataConTyCon :: TyCon
- vecRepDataConTyCon :: TyCon
- tupleRepDataConTyCon :: TyCon
- sumRepDataConTyCon :: TyCon
- liftedRepDataConTy :: Type
- unliftedRepDataConTy :: Type
- intRepDataConTy :: Type
- wordRepDataConTy :: Type
- int64RepDataConTy :: Type
- word64RepDataConTy :: Type
- addrRepDataConTy :: Type
- floatRepDataConTy :: Type
- doubleRepDataConTy :: Type
- vec2DataConTy :: Type
- vec4DataConTy :: Type
- vec8DataConTy :: Type
- vec16DataConTy :: Type
- vec32DataConTy :: Type
- vec64DataConTy :: Type
- int8ElemRepDataConTy :: Type
- int16ElemRepDataConTy :: Type
- int32ElemRepDataConTy :: Type
- int64ElemRepDataConTy :: Type
- word8ElemRepDataConTy :: Type
- word16ElemRepDataConTy :: Type
- word32ElemRepDataConTy :: Type
- word64ElemRepDataConTy :: Type
- floatElemRepDataConTy :: Type
- doubleElemRepDataConTy :: Type

# Helper functions defined here

mkWiredInTyConName :: BuiltInSyntax -> Module -> FastString -> Unique -> TyCon -> Name Source #

mkWiredInIdName :: Module -> FastString -> Unique -> Id -> Name Source #

mkFunKind :: Kind -> Kind -> Kind Source #

mkForAllKind :: TyVar -> ArgFlag -> Kind -> Kind Source #

# All wired in things

wiredInTyCons :: [TyCon] Source #

isBuiltInOcc_maybe :: OccName -> Maybe Name Source #

Built-in syntax isn't "in scope" so these OccNames map to wired-in Names with BuiltInSyntax. However, this should only be necessary while resolving names produced by Template Haskell splices since we take care to encode built-in syntax names specially in interface files. See Note [Symbol table representation of names].

Moreover, there is no need to include names of things that the user can't write (e.g. type representation bindings like $tc(,,,)).

# Bool

boolTy :: Type Source #

boolTyCon :: TyCon Source #

boolTyCon_RDR :: RdrName Source #

boolTyConName :: Name Source #

trueDataCon :: DataCon Source #

trueDataConId :: Id Source #

true_RDR :: RdrName Source #

falseDataCon :: DataCon Source #

falseDataConId :: Id Source #

false_RDR :: RdrName Source #

promotedFalseDataCon :: TyCon Source #

promotedTrueDataCon :: TyCon Source #

# Ordering

orderingTyCon :: TyCon Source #

ltDataCon :: DataCon Source #

ltDataConId :: Id Source #

eqDataCon :: DataCon Source #

eqDataConId :: Id Source #

gtDataCon :: DataCon Source #

gtDataConId :: Id Source #

promotedLTDataCon :: TyCon Source #

promotedEQDataCon :: TyCon Source #

promotedGTDataCon :: TyCon Source #

# Boxing primitive types

boxingDataCon_maybe :: TyCon -> Maybe DataCon Source #

# Char

charTyCon :: TyCon Source #

charDataCon :: DataCon Source #

charTyCon_RDR :: RdrName Source #

charTy :: Type Source #

stringTy :: Type Source #

charTyConName :: Name Source #

# Double

doubleTyCon :: TyCon Source #

doubleDataCon :: DataCon Source #

doubleTy :: Type Source #

doubleTyConName :: Name Source #

# Float

floatTyCon :: TyCon Source #

floatDataCon :: DataCon Source #

floatTy :: Type Source #

floatTyConName :: Name Source #

# Int

intTyCon :: TyCon Source #

intDataCon :: DataCon Source #

intTyCon_RDR :: RdrName Source #

intDataCon_RDR :: RdrName Source #

intTyConName :: Name Source #

intTy :: Type Source #

# Word

wordTyCon :: TyCon Source #

wordDataCon :: DataCon Source #

wordTyConName :: Name Source #

wordTy :: Type Source #

# Word8

word8TyCon :: TyCon Source #

word8DataCon :: DataCon Source #

word8TyConName :: Name Source #

word8Ty :: Type Source #

# List

listTyCon :: TyCon Source #

listTyCon_RDR :: RdrName Source #

listTyConName :: Name Source #

listTyConKey :: Unique Source #

nilDataCon :: DataCon Source #

nilDataConName :: Name Source #

nilDataConKey :: Unique Source #

consDataCon_RDR :: RdrName Source #

consDataCon :: DataCon Source #

consDataConName :: Name Source #

promotedNilDataCon :: TyCon Source #

promotedConsDataCon :: TyCon Source #

mkListTy :: Type -> Type Source #

mkPromotedListTy Source #

Arguments

:: Kind | of the elements of the list
-> [Type] | elements
-> Type |

Make a *promoted* list.

# Maybe

maybeTyCon :: TyCon Source #

maybeTyConName :: Name Source #

nothingDataCon :: DataCon Source #

nothingDataConName :: Name Source #

promotedNothingDataCon :: TyCon Source #

justDataCon :: DataCon Source #

justDataConName :: Name Source #

promotedJustDataCon :: TyCon Source #

# Tuples

mkTupleTy :: Boxity -> [Type] -> Type Source #

Make a tuple type. The list of types should not include any RuntimeRep specifications.

mkBoxedTupleTy :: [Type] -> Type Source #

Build the type of a small tuple that holds the specified type of thing

tupleTyCon :: Boxity -> Arity -> TyCon Source #

tupleDataCon :: Boxity -> Arity -> DataCon Source #

tupleTyConName :: TupleSort -> Arity -> Name Source #

promotedTupleDataCon :: Boxity -> Arity -> TyCon Source #

unitTyCon :: TyCon Source #

unitDataCon :: DataCon Source #

unitDataConId :: Id Source #

unitTy :: Type Source #

unitTyConKey :: Unique Source #

pairTyCon :: TyCon Source #

unboxedUnitTyCon :: TyCon Source #

unboxedUnitDataCon :: DataCon Source #

unboxedTupleKind :: [Type] -> Kind Source #

Specialization of `unboxedTupleSumKind` for tuples

unboxedSumKind :: [Type] -> Kind Source #

Specialization of `unboxedTupleSumKind` for sums

## Constraint tuples

cTupleTyConName :: Arity -> Name Source #

cTupleTyConNames :: [Name] Source #

isCTupleTyConName :: Name -> Bool Source #

cTupleDataConName :: Arity -> Name Source #

cTupleDataConNames :: [Name] Source #

# Any

anyTyCon :: TyCon Source #

anyTy :: Type Source #

anyTypeOfKind :: Kind -> Type Source #

# Sums

mkSumTy :: [Type] -> Type Source #

sumTyCon :: Arity -> TyCon Source #

Type constructor for n-ary unboxed sum.

sumDataCon :: ConTag -> Arity -> DataCon Source #

Data constructor for i-th alternative of a n-ary unboxed sum.

# Kinds

typeNatKindCon :: TyCon Source #

typeNatKind :: Kind Source #

typeSymbolKindCon :: TyCon Source #

typeSymbolKind :: Kind Source #

isLiftedTypeKindTyConName :: Name -> Bool Source #

liftedTypeKind :: Kind Source #

constraintKind :: Kind Source #

starKindTyCon :: TyCon Source #

starKindTyConName :: Name Source #

unicodeStarKindTyCon :: TyCon Source #

unicodeStarKindTyConName :: Name Source #

liftedTypeKindTyCon :: TyCon Source #

constraintKindTyCon :: TyCon Source #

# Parallel arrays

mkPArrTy :: Type -> Type Source #

Construct a type representing the application of the parallel array constructor

parrTyCon :: TyCon Source #

Represents the type constructor of parallel arrays

- This must match the definition in `PrelPArr`

NB: Although the constructor is given here, it will not be accessible in user code as it is not in the environment of any compiled module except `PrelPArr`.

parrFakeCon :: Arity -> DataCon Source #

Fake array constructors

- These constructors are never really used to represent array values; however, they are very convenient during desugaring (and, in particular, in the pattern matching compiler) to treat array pattern just like yet another constructor pattern

isPArrTyCon :: TyCon -> Bool Source #

Check whether a type constructor is the constructor for parallel arrays

isPArrFakeCon :: DataCon -> Bool Source #

Checks whether a data constructor is a fake constructor for parallel arrays

parrTyCon_RDR :: RdrName Source #

parrTyConName :: Name Source #

# Equality predicates

heqTyCon :: TyCon Source #

heqClass :: Class Source #

heqDataCon :: DataCon Source #

coercibleTyCon :: TyCon Source #

coercibleDataCon :: DataCon Source #

coercibleClass :: Class Source #

# RuntimeRep and friends

runtimeRepTyCon :: TyCon Source #

vecCountTyCon :: TyCon Source #

vecElemTyCon :: TyCon Source #

runtimeRepTy :: Type Source #

liftedRepTy :: Type Source #

liftedRepDataCon :: DataCon Source #

liftedRepDataConTyCon :: TyCon Source #

vecRepDataConTyCon :: TyCon Source #

tupleRepDataConTyCon :: TyCon Source #

sumRepDataConTyCon :: TyCon Source #

liftedRepDataConTy :: Type Source #

unliftedRepDataConTy :: Type Source #

intRepDataConTy :: Type Source #

wordRepDataConTy :: Type Source #

int64RepDataConTy :: Type Source #

word64RepDataConTy :: Type Source #

addrRepDataConTy :: Type Source #

floatRepDataConTy :: Type Source #

doubleRepDataConTy :: Type Source #

vec2DataConTy :: Type Source #

vec4DataConTy :: Type Source #

vec8DataConTy :: Type Source #

vec16DataConTy :: Type Source #

vec32DataConTy :: Type Source #

vec64DataConTy :: Type Source #

int8ElemRepDataConTy :: Type Source #

int16ElemRepDataConTy :: Type Source #

int32ElemRepDataConTy :: Type Source #

int64ElemRepDataConTy :: Type Source #

word8ElemRepDataConTy :: Type Source #

word16ElemRepDataConTy :: Type Source #

word32ElemRepDataConTy :: Type Source #

word64ElemRepDataConTy :: Type Source #

floatElemRepDataConTy :: Type Source #

doubleElemRepDataConTy :: Type Source #