plutus-core-1.0.0.1: Language library for Plutus Core
Safe Haskell None
Language Haskell2010

PlutusCore.Rename.Monad

Description

The monad that the renamer runs in and related infrastructure.

Synopsis

Documentation

newtype RenameT ren m a Source #

The monad the renamer runs in.

Constructors

RenameT

Fields

Instances

Instances details
Monad m => MonadReader ren ( RenameT ren m) Source #
Instance details

Defined in PlutusCore.Rename.Monad

Methods

ask :: RenameT ren m ren Source #

local :: (ren -> ren) -> RenameT ren m a -> RenameT ren m a Source #

reader :: (ren -> a) -> RenameT ren m a Source #

Monad m => Monad ( RenameT ren m) Source #
Instance details

Defined in PlutusCore.Rename.Monad

Methods

(>>=) :: RenameT ren m a -> (a -> RenameT ren m b) -> RenameT ren m b Source #

(>>) :: RenameT ren m a -> RenameT ren m b -> RenameT ren m b Source #

return :: a -> RenameT ren m a Source #

Functor m => Functor ( RenameT ren m) Source #
Instance details

Defined in PlutusCore.Rename.Monad

Methods

fmap :: (a -> b) -> RenameT ren m a -> RenameT ren m b Source #

(<$) :: a -> RenameT ren m b -> RenameT ren m a Source #

Applicative m => Applicative ( RenameT ren m) Source #
Instance details

Defined in PlutusCore.Rename.Monad

Methods

pure :: a -> RenameT ren m a Source #

(<*>) :: RenameT ren m (a -> b) -> RenameT ren m a -> RenameT ren m b Source #

liftA2 :: (a -> b -> c) -> RenameT ren m a -> RenameT ren m b -> RenameT ren m c Source #

(*>) :: RenameT ren m a -> RenameT ren m b -> RenameT ren m b Source #

(<*) :: RenameT ren m a -> RenameT ren m b -> RenameT ren m a Source #

Alternative m => Alternative ( RenameT ren m) Source #
Instance details

Defined in PlutusCore.Rename.Monad

MonadQuote m => MonadQuote ( RenameT ren m) Source #
Instance details

Defined in PlutusCore.Rename.Monad

newtype Renaming unique Source #

A renaming is a mapping from old uniques to new ones.

Constructors

Renaming

Fields

type TypeRenaming = Renaming TypeUnique Source #

A type-level renaming. Needed for instantiating functions running over types in generic RenameT ren m to a particular type of renaming.

runRenameT :: Monoid ren => RenameT ren m a -> m a Source #

Run a RenameT computation with an empty renaming.

lookupNameM :: ( HasUnique name unique, HasRenaming ren unique, MonadReader ren m) => name -> m ( Maybe unique) Source #

Look up the new unique a name got mapped to.

renameNameM :: ( HasRenaming ren unique, HasUnique name unique, MonadReader ren m) => name -> m name Source #

Rename a name that has a unique inside.

withFreshenedName :: ( HasRenaming ren unique, HasUnique name unique, MonadQuote m, MonadReader ren m) => name -> (name -> m c) -> m c Source #

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

withRenamedName :: ( HasRenaming ren unique, HasUnique name unique, MonadReader ren m) => name -> name -> m c -> m c Source #

Run a RenameT computation in the environment extended by the mapping from an old name to a new one.