ghc-7.8.20140130: The GHC API

Safe HaskellNone
LanguageHaskell98

Vectorise.Utils.Base

Synopsis

Documentation

mkWrapType :: Type -> VM TypeSource

Make an application of the Wrap type constructor.

mkClosureTypes :: [Type] -> Type -> VM TypeSource

Make an application of the closure type constructor.

mkPReprType :: Type -> VM TypeSource

Make an application of the PRepr type constructor.

mkPDataType :: Type -> VM TypeSource

Make an appliction of the PData tycon to some argument.

mkPDatasType :: Type -> VM TypeSource

Make an application of the PDatas tycon to some argument.

splitPrimTyCon :: Type -> Maybe TyConSource

Checks if a type constructor is defined in Prim (e.g., Int#); if so, returns it.

mkBuiltinCo :: (Builtins -> TyCon) -> VM CoercionSource

Make a representational coersion to some builtin type.

wrapNewTypeBodyOfWrap :: CoreExpr -> Type -> VM CoreExprSource

Apply the constructor wrapper of the Wrap newtype.

unwrapNewTypeBodyOfWrap :: CoreExpr -> Type -> VM CoreExprSource

Strip the constructor wrapper of the Wrap newtype.

wrapNewTypeBodyOfPDataWrap :: CoreExpr -> Type -> VM CoreExprSource

Apply the constructor wrapper of the PData newtype instance of Wrap.

unwrapNewTypeBodyOfPDataWrap :: CoreExpr -> Type -> VM CoreExprSource

Strip the constructor wrapper of the PData newtype instance of Wrap.

wrapNewTypeBodyOfPDatasWrap :: CoreExpr -> Type -> VM CoreExprSource

Apply the constructor wrapper of the PDatas newtype instance of Wrap.

unwrapNewTypeBodyOfPDatasWrap :: CoreExpr -> Type -> VM CoreExprSource

Strip the constructor wrapper of the PDatas newtype instance of Wrap.

pdataReprTyCon :: Type -> VM (TyCon, [Type])Source

Get the representation tycon of the PData data family for a given type.

This tycon does not appear explicitly in the source program — see Note [PData TyCons] in Description:

pdataReprTyCon {Sum2} = {PDataSum2}

The type for which we look up a PData instance may be more specific than the type in the instance declaration. In that case the second component of the result will be more specific than a set of distinct type variables.

pdataReprTyConExact :: TyCon -> VM TyConSource

Get the representation tycon of the PData data family for a given type constructor.

For example, for a binary type constructor T, we determine the representation type constructor for 'PData (T a b)'.

pdatasReprTyConExact :: TyCon -> VM TyConSource

Get the representation tycon of the PDatas data family for a given type constructor.

For example, for a binary type constructor T, we determine the representation type constructor for 'PDatas (T a b)'.

pdataUnwrapScrut :: VExpr -> VM (CoreExpr, CoreExpr, DataCon)Source

Unwrap a PData representation scrutinee.

preprSynTyCon :: Type -> VM FamInstMatchSource

Get the representation tycon of the PRepr type family for a given type.