ghc-8.2.0.20170404: The GHC API

Safe HaskellNone
LanguageHaskell2010

TysWiredIn (signature[?])

Contents

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

Helper functions defined here

All wired in things

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

Ordering

Boxing primitive types

Char

Double

Float

Int

Word

Word8

List

mkPromotedListTy Source #

Arguments

:: Kind

of the elements of the list

-> [Type]

elements

-> Type 

Make a *promoted* list.

Maybe

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

unboxedTupleKind :: [Type] -> Kind Source #

Specialization of unboxedTupleSumKind for tuples

unboxedSumKind :: [Type] -> Kind Source #

Specialization of unboxedTupleSumKind for sums

Constraint tuples

Any

Sums

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

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

Equality predicates

RuntimeRep and friends