ghc-7.0.3: 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

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

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

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

cloneVar :: Var -> VM Var

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

newExportedVar :: OccName -> Type -> VM Var

Make a fresh exported variable with the given type.

newLocalVar :: FastString -> Type -> VM Var

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]

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

Make a new local dummy variable.

newTyVar :: FastString -> Kind -> VM Var

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