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

PlutusCore.Rename

Description

The user-facing API of the renamer.

Synopsis

Documentation

class Rename a where Source #

The class of things that can be renamed. I.e. things that are capable of satisfying the global uniqueness condition.

Methods

rename :: MonadQuote m => a -> m a Source #

Rename Uniques so that they're globally unique. In case there are any free variables, they must be left untouched and bound variables must not get renamed to free ones. Must always assign new names to bound variables, so that rename can be used for alpha-renaming as well.

Instances

Instances details
Rename a => Rename (Normalized a) Source # 
Instance details

Defined in PlutusCore.Rename

Methods

rename :: MonadQuote m => Normalized a -> m (Normalized a) Source #

HasUniques (Type tyname uni ann) => Rename (Type tyname uni ann) Source # 
Instance details

Defined in PlutusCore.Rename

Methods

rename :: MonadQuote m => Type tyname uni ann -> m (Type tyname uni ann) Source #

HasUniques (Program name uni fun ann) => Rename (Program name uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Rename

Methods

rename :: MonadQuote m => Program name uni fun ann -> m (Program name uni fun ann) Source #

HasUniques (Term name uni fun ann) => Rename (Term name uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Rename

Methods

rename :: MonadQuote m => Term name uni fun ann -> m (Term name uni fun ann) Source #

HasUniques (Program tyname name uni fun ann) => Rename (Program tyname name uni fun ann) Source # 
Instance details

Defined in PlutusCore.Rename

Methods

rename :: MonadQuote m => Program tyname name uni fun ann -> m (Program tyname name uni fun ann) Source #

HasUniques (Term tyname name uni fun ann) => Rename (Term tyname name uni fun ann) Source # 
Instance details

Defined in PlutusCore.Rename

Methods

rename :: MonadQuote m => Term tyname name uni fun ann -> m (Term tyname name uni fun ann) Source #

HasUniques (Term tyname name uni fun ann) => Rename (Program tyname name uni fun ann) Source # 
Instance details

Defined in PlutusIR.Transform.Rename

Methods

rename :: MonadQuote m => Program tyname name uni fun ann -> m (Program tyname name uni fun ann) Source #

HasUniques (Term tyname name uni fun ann) => Rename (Term tyname name uni fun ann) Source # 
Instance details

Defined in PlutusIR.Transform.Rename

Methods

rename :: MonadQuote m => Term tyname name uni fun ann -> m (Term tyname name uni fun ann) Source #

data Dupable a Source #

Dupable a is isomorphic to a, but the only way to extract the a is via liftDupable which renames the stored value along the way. This type is used whenever

  1. preserving global uniqueness is required
  2. some value may be used multiple times

so we annotate such a value with Dupable and call liftDupable at each usage, which ensures global conditions is preserved.

Instances

Instances details
Monad Dupable Source # 
Instance details

Defined in PlutusCore.Rename

Methods

(>>=) :: Dupable a -> (a -> Dupable b) -> Dupable b Source #

(>>) :: Dupable a -> Dupable b -> Dupable b Source #

return :: a -> Dupable a Source #

Functor Dupable Source # 
Instance details

Defined in PlutusCore.Rename

Methods

fmap :: (a -> b) -> Dupable a -> Dupable b Source #

(<$) :: a -> Dupable b -> Dupable a Source #

Applicative Dupable Source # 
Instance details

Defined in PlutusCore.Rename

Methods

pure :: a -> Dupable a Source #

(<*>) :: Dupable (a -> b) -> Dupable a -> Dupable b Source #

liftA2 :: (a -> b -> c) -> Dupable a -> Dupable b -> Dupable c Source #

(*>) :: Dupable a -> Dupable b -> Dupable b Source #

(<*) :: Dupable a -> Dupable b -> Dupable a Source #

Foldable Dupable Source # 
Instance details

Defined in PlutusCore.Rename

Methods

fold :: Monoid m => Dupable m -> m Source #

foldMap :: Monoid m => (a -> m) -> Dupable a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Dupable a -> m Source #

foldr :: (a -> b -> b) -> b -> Dupable a -> b Source #

foldr' :: (a -> b -> b) -> b -> Dupable a -> b Source #

foldl :: (b -> a -> b) -> b -> Dupable a -> b Source #

foldl' :: (b -> a -> b) -> b -> Dupable a -> b Source #

foldr1 :: (a -> a -> a) -> Dupable a -> a Source #

foldl1 :: (a -> a -> a) -> Dupable a -> a Source #

toList :: Dupable a -> [a] Source #

null :: Dupable a -> Bool Source #

length :: Dupable a -> Int Source #

elem :: Eq a => a -> Dupable a -> Bool Source #

maximum :: Ord a => Dupable a -> a Source #

minimum :: Ord a => Dupable a -> a Source #

sum :: Num a => Dupable a -> a Source #

product :: Num a => Dupable a -> a Source #

Traversable Dupable Source # 
Instance details

Defined in PlutusCore.Rename

Methods

traverse :: Applicative f => (a -> f b) -> Dupable a -> f (Dupable b) Source #

sequenceA :: Applicative f => Dupable (f a) -> f (Dupable a) Source #

mapM :: Monad m => (a -> m b) -> Dupable a -> m (Dupable b) Source #

sequence :: Monad m => Dupable (m a) -> m (Dupable a) Source #

Eq a => Eq (Dupable a) Source # 
Instance details

Defined in PlutusCore.Rename

Methods

(==) :: Dupable a -> Dupable a -> Bool Source #

(/=) :: Dupable a -> Dupable a -> Bool Source #

Show a => Show (Dupable a) Source # 
Instance details

Defined in PlutusCore.Rename

liftDupable :: (MonadQuote m, Rename a) => Dupable a -> m a Source #

Extract the value stored in a Dupable a and rename it.