Safe Haskell | None |
---|---|
Language | Haskell2010 |
The user-facing API of the renamer.
Synopsis
-
class
Rename
a
where
- rename :: MonadQuote m => a -> m a
- data Dupable a
- liftDupable :: ( MonadQuote m, Rename a) => Dupable a -> m a
Documentation
The class of things that can be renamed. I.e. things that are capable of satisfying the global uniqueness condition.
rename :: MonadQuote m => a -> m a Source #
Rename
Unique
s 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
Rename a => Rename ( Normalized a) Source # | |
Defined in PlutusCore.Rename rename :: MonadQuote m => Normalized a -> m ( Normalized a) Source # |
|
HasUniques ( Type tyname uni ann) => Rename ( Type tyname uni ann) Source # | |
Defined in PlutusCore.Rename |
|
HasUniques ( Program name uni fun ann) => Rename ( Program name uni fun ann) Source # | |
Defined in UntypedPlutusCore.Rename |
|
HasUniques ( Term name uni fun ann) => Rename ( Term name uni fun ann) Source # | |
Defined in UntypedPlutusCore.Rename |
|
HasUniques ( Program tyname name uni fun ann) => Rename ( Program tyname name uni fun ann) Source # | |
Defined in PlutusCore.Rename |
|
HasUniques ( Term tyname name uni fun ann) => Rename ( Term tyname name uni fun ann) Source # | |
Defined in PlutusCore.Rename |
|
HasUniques ( Term tyname name uni fun ann) => Rename ( Program tyname name uni fun ann) Source # | |
Defined in PlutusIR.Transform.Rename |
|
HasUniques ( Term tyname name uni fun ann) => Rename ( Term tyname name uni fun ann) Source # | |
Defined in PlutusIR.Transform.Rename |
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
- preserving global uniqueness is required
- 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
Monad Dupable Source # | |
Functor Dupable Source # | |
Applicative Dupable Source # | |
Foldable Dupable Source # | |
Defined in PlutusCore.Rename 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 # |
|
Traversable Dupable Source # | |
Defined in PlutusCore.Rename |
|
Eq a => Eq ( Dupable a) Source # | |
Show a => Show ( Dupable a) Source # | |
liftDupable :: ( MonadQuote m, Rename a) => Dupable a -> m a Source #
Extract the value stored in a
Dupable a
and rename it.