Vectorise.Utils.Poly

ghc-7.8.3: The GHC API

Safe Haskell | None
Language | Haskell98

Vectorise.Utils.Poly

Description

Auxiliary functions to vectorise type abstractions.

Synopsis

- polyAbstract :: [TyVar] -> ([Var] -> VM a) -> VM a
- polyApply :: CoreExpr -> [Type] -> VM CoreExpr
- polyVApply :: VExpr -> [Type] -> VM VExpr
- polyArity :: [TyVar] -> VM Int

# Documentation

polyAbstract :: [TyVar] -> ([Var] -> VM a) -> VM a Source

Vectorise under the `PA` dictionary variables corresponding to a set of type arguments.

The dictionary variables are new local variables that are entered into the local vectorisation map.

The purpose of this function is to introduce the additional `PA` dictionary arguments that are needed when vectorising type abstractions.

polyApply :: CoreExpr -> [Type] -> VM CoreExpr Source

Apply a expression to its type arguments as well as `PA` dictionaries for these type arguments.

polyVApply :: VExpr -> [Type] -> VM VExpr Source

Apply a vectorised expression to a set of type arguments together with `PA` dictionaries for these type arguments.

polyArity :: [TyVar] -> VM Int Source

Determine the number of `PA` dictionary arguments required for a set of type variables (depends on their kinds).