plutus-core-1.0.0.1: Language library for Plutus Core
Safe HaskellNone
LanguageHaskell2010

PlutusCore.Rename.Internal

Description

The internal module of the renamer that defines the actual algorithms, but not the user-facing API.

Synopsis

Documentation

withFreshenedTyVarDecl :: (HasRenaming ren TypeUnique, HasUniques (Type tyname uni ann), MonadQuote m, MonadReader ren m) => TyVarDecl tyname ann -> (TyVarDecl tyname ann -> m c) -> m c Source #

Replace the unique in the name stored in a TyVarDecl by a new unique, save the mapping from the old unique to the new one and supply the updated TyVarDecl to a continuation.

withFreshenedVarDecl :: (HasUniques (Term tyname name uni fun ann), MonadQuote m, MonadReader ScopedRenaming m) => VarDecl tyname name uni fun ann -> (m (VarDecl tyname name uni fun ann) -> m c) -> m c Source #

Replace the unique in the name stored in a VarDecl by a new unique, save the mapping from the old unique to the new one and supply to a continuation the computation that renames the type stored in the updated VarDecl. The reason the continuation receives a computation rather than a pure term is that we may want to bring several term and type variables in scope before renaming the types of term variables. This situation arises when we want to rename a bunch of mutually recursive bindings.

renameTypeM :: (HasRenaming ren TypeUnique, HasUniques (Type tyname uni ann), MonadQuote m, MonadReader ren m) => Type tyname uni ann -> m (Type tyname uni ann) Source #

Rename a Type in the RenameM monad.

renameTermM :: (HasUniques (Term tyname name uni fun ann), MonadQuote m, MonadReader ScopedRenaming m) => Term tyname name uni fun ann -> m (Term tyname name uni fun ann) Source #

Rename a Term in the RenameM monad.

renameProgramM :: (HasUniques (Program tyname name uni fun ann), MonadQuote m, MonadReader ScopedRenaming m) => Program tyname name uni fun ann -> m (Program tyname name uni fun ann) Source #

Rename a Program in the RenameM monad.