ghc-7.4.2: The GHC API

Safe HaskellNone

Vectorise.Generic.Description

Description

Compute a description of the generic representation that we use for a user defined data type.

During vectorisation, we generate a PRepr and PA instance for each user defined data type. The PA dictionary contains methods to convert the user type to and from our generic representation. This module computes a description of what that generic representation is.

Synopsis

Documentation

data CompRepr Source

Describes the representation type of a data constructor field.

Constructors

Keep Type CoreExpr 
Wrap Type 

Instances

data ProdRepr Source

Describes the representation type of the fields / components of a constructor. If the data constructor has multiple fields then we bundle them together into a generic product type.

Constructors

EmptyProd

Data constructor has no fields.

UnaryProd CompRepr

Data constructor has a single field.

Prod

Data constructor has several fields.

Fields

repr_tup_tc :: TyCon

Representation tycon for the product (eg Tuple2)

repr_ptup_tc :: TyCon

PData version of the product tycon (eg PDataTuple2)

repr_ptups_tc :: TyCon

PDatas version of the product tycon (eg PDatasTuple2s) Not all lifted backends use PDatas.

repr_comp_tys :: [Type]

Types of each field.

repr_comps :: [CompRepr]

Generic representation types for each field.

Instances

data ConRepr Source

Describes the representation type of a data constructor.

Constructors

ConRepr 

Instances

data SumRepr Source

Describes the generic representation of a data type. If the data type has multiple constructors then we bundle them together into a generic sum type.

Constructors

EmptySum

Data type has no data constructors.

UnarySum ConRepr

Data type has a single constructor.

Sum

Data type has multiple constructors.

Fields

repr_sum_tc :: TyCon

Representation tycon for the sum (eg Sum2)

repr_psum_tc :: TyCon

PData version of the sum tycon (eg PDataSum2) This TyCon doesn't appear explicitly in the source program. See Note [PData TyCons].

repr_psums_tc :: TyCon

PDatas version of the sum tycon (eg PDatasSum2)

repr_sel_ty :: Type

Type of the selector (eg Sel2)

repr_sels_ty :: Type

Type of multi-selector (eg Sel2s)

repr_selsLength_v :: CoreExpr

Function to get the length of a Sels of this type.

repr_con_tys :: [Type]

Type of each data constructor.

repr_cons :: [ConRepr]

Generic representation types of each data constructor.

Instances

tyConRepr :: TyCon -> VM SumReprSource

Determine the generic representation of a data type, given its tycon.

sumReprType :: SumRepr -> VM TypeSource

Yield the type of this sum representation.

compOrigType :: CompRepr -> TypeSource

Yield the original component type of a data constructor component representation.