Safe Haskell | None |
---|---|
Language | Haskell2010 |
The internal module of the renamer that defines the actual algorithms, but not the user-facing API.
Synopsis
- module PlutusCore.Rename.Monad
- withFreshenedTyVarDecl :: (HasRenaming ren TypeUnique, HasUniques (Type tyname uni ann), MonadQuote m, MonadReader ren m) => TyVarDecl tyname ann -> (TyVarDecl tyname ann -> m c) -> m c
- 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
- renameTypeM :: (HasRenaming ren TypeUnique, HasUniques (Type tyname uni ann), MonadQuote m, MonadReader ren m) => Type tyname uni ann -> m (Type tyname uni ann)
- 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)
- 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)
Documentation
module PlutusCore.Rename.Monad
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 #
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.