Vectorise.Var
Description
Vectorise variables and literals.
- vectBndr :: Var -> VM VVar
- vectBndrNew :: Var -> FastString -> VM VVar
- vectBndrIn :: Var -> VM a -> VM (VVar, a)
- vectBndrNewIn :: Var -> FastString -> VM a -> VM (VVar, a)
- vectBndrsIn :: [Var] -> VM a -> VM ([VVar], a)
- vectVar :: Var -> VM VExpr
- vectPolyVar :: Var -> [Type] -> VM VExpr
- vectLiteral :: Literal -> VM VExpr
Documentation
vectBndrNew :: Var -> FastString -> VM VVar
Vectorise a binder variable, along with its attached type, but give the result a new name.
vectBndrIn :: Var -> VM a -> VM (VVar, a)
Vectorise a binder then run a computation with that binder in scope.
vectBndrNewIn :: Var -> FastString -> VM a -> VM (VVar, a)
Vectorise a binder, give it a new name, then run a computation with that binder in scope.
vectBndrsIn :: [Var] -> VM a -> VM ([VVar], a)
Vectorise some binders, then run a computation with them in scope.
vectPolyVar :: Var -> [Type] -> VM VExpr
Like vectVar
but also add type applications to the variables.
vectLiteral :: Literal -> VM VExpr
Lifted literals are created by replicating them
We use the the integer context in the VM
state for the number
of elements in the output array.