ghc-7.0.4: The GHC API

Vectorise.Monad.Naming

Description

Computations in the vectorisation monad concerned with naming and fresh variable generation.

Synopsis

- cloneName :: (OccName -> OccName) -> Name -> VM Name
- cloneId :: (OccName -> OccName) -> Id -> Type -> VM Id
- cloneVar :: Var -> VM Var
- newExportedVar :: OccName -> Type -> VM Var
- newLocalVar :: FastString -> Type -> VM Var
- newLocalVars :: FastString -> [Type] -> VM [Var]
- newDummyVar :: Type -> VM Var
- newTyVar :: FastString -> Kind -> VM Var

# Documentation

cloneName :: (OccName -> OccName) -> Name -> VM Name Source

Clone a name, using the provide function to transform its `OccName`.

cloneId :: (OccName -> OccName) -> Id -> Type -> VM Id Source

Clone an `Id`, using the provided function to transform its `OccName`.

cloneVar :: Var -> VM Var Source

Make a fresh instance of this var, with a new unique.

newExportedVar :: OccName -> Type -> VM Var Source

Make a fresh exported variable with the given type.

newLocalVar :: FastString -> Type -> VM Var Source

Make a fresh local variable with the given type. The variable's name is formed using the given string as the prefix.

newLocalVars :: FastString -> [Type] -> VM [Var]Source

Make several fresh local varaiables with the given types. The variable's names are formed using the given string as the prefix.

newDummyVar :: Type -> VM Var Source

Make a new local dummy variable.

newTyVar :: FastString -> Kind -> VM Var Source

Make a fresh type variable with the given kind. The variable's name is formed using the given string as the prefix.