Vectorise.Monad.Naming

ghc-8.2.0.20170404: The GHC API

Safe Haskell | None
Language | Haskell2010

Vectorise.Monad.Naming (signature[?])

Description

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

Synopsis

- mkLocalisedName :: (Maybe String -> OccName -> OccName) -> Name -> VM Name
- mkDerivedName :: (OccName -> OccName) -> Name -> VM Name
- mkVectId :: 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
- newCoVar :: FastString -> Kind -> VM Var

# Documentation

mkLocalisedName :: (Maybe String -> OccName -> OccName) -> Name -> VM Name Source #

Create a localised variant of a name, using the provided function to transform its `OccName`.

If the name external, encode the original name's module into the new `OccName`. The result is always an internal system name.

mkDerivedName :: (OccName -> OccName) -> Name -> VM Name Source #

mkVectId :: Id -> Type -> VM Id Source #

Produce the vectorised variant of an `Id` with the given vectorised type, while taking care that vectorised dfun ids must be dfuns again.

Force the new name to be a system name and, if the original was an external name, disambiguate the new name with the module name of the original.

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 variables 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.

newCoVar :: FastString -> Kind -> VM Var Source #

Make a fresh coercion variable with the given kind.