Safe Haskell | None |
---|---|
Language | Haskell98 |
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.
- data CompRepr
- data ProdRepr
- = EmptyProd
- | UnaryProd CompRepr
- | Prod {
- repr_tup_tc :: TyCon
- repr_ptup_tc :: TyCon
- repr_ptups_tc :: TyCon
- repr_comp_tys :: [Type]
- repr_comps :: [CompRepr]
- data ConRepr = ConRepr {}
- data SumRepr
- = EmptySum
- | UnarySum ConRepr
- | Sum {
- repr_sum_tc :: TyCon
- repr_psum_tc :: TyCon
- repr_psums_tc :: TyCon
- repr_sel_ty :: Type
- repr_sels_ty :: Type
- repr_selsLength_v :: CoreExpr
- repr_con_tys :: [Type]
- repr_cons :: [ConRepr]
- tyConRepr :: TyCon -> VM SumRepr
- sumReprType :: SumRepr -> VM Type
- compOrigType :: CompRepr -> Type
Documentation
Describes the representation type of a data constructor field.
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.
EmptyProd | Data constructor has no fields. |
UnaryProd CompRepr | Data constructor has a single field. |
Prod | Data constructor has several fields. |
|
Describes the representation type of a data constructor.
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.
EmptySum | Data type has no data constructors. |
UnarySum ConRepr | Data type has a single constructor. |
Sum | Data type has multiple constructors. |
|
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.