Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- runQuoteT :: Monad m => QuoteT m a -> m a
- runQuote :: Quote a -> a
- freshUnique :: MonadQuote m => m Unique
- freshName :: MonadQuote m => Text -> m Name
- freshTyName :: MonadQuote m => Text -> m TyName
- freshenName :: MonadQuote m => Name -> m Name
- freshenTyName :: MonadQuote m => TyName -> m TyName
- newtype QuoteT m a = QuoteT {
- unQuoteT :: StateT FreshState m a
- type Quote = QuoteT Identity
- class Monad m => MonadQuote m
- type FreshState = Unique
- liftQuote :: MonadQuote m => Quote a -> m a
- markNonFreshBelow :: MonadQuote m => Unique -> m ()
- markNonFresh :: MonadQuote m => Unique -> m ()
- markNonFreshMax :: MonadQuote m => Set Unique -> m ()
Documentation
runQuoteT :: Monad m => QuoteT m a -> m a Source #
Run a quote from an empty identifier state. Note that the resulting term cannot necessarily
be safely combined with other terms - that should happen inside QuoteT
.
freshUnique :: MonadQuote m => m Unique Source #
Get a fresh Unique
.
freshTyName :: MonadQuote m => Text -> m TyName Source #
freshenName :: MonadQuote m => Name -> m Name Source #
Make a copy of the given Name
that is distinct from the old one.
freshenTyName :: MonadQuote m => TyName -> m TyName Source #
Make a copy of the given TyName
that is distinct from the old one.
The "quotation" monad transformer. Within this monad you can do safe construction of PLC terms using quasiquotation, fresh-name generation, and parsing.
QuoteT | |
|
Instances
MonadTrans QuoteT Source # | |
MFunctor QuoteT Source # | |
Defined in PlutusCore.Quote | |
MonadError e m => MonadError e (QuoteT m) Source # | |
Defined in PlutusCore.Quote throwError :: e -> QuoteT m a Source # catchError :: QuoteT m a -> (e -> QuoteT m a) -> QuoteT m a Source # | |
MonadReader r m => MonadReader r (QuoteT m) Source # | |
MonadState s m => MonadState s (QuoteT m) Source # | |
MonadWriter w m => MonadWriter w (QuoteT m) Source # | |
MonadFix m => MonadFix (QuoteT m) Source # | |
MonadIO m => MonadIO (QuoteT m) Source # | |
Monad m => Applicative (QuoteT m) Source # | |
Defined in PlutusCore.Quote | |
Functor m => Functor (QuoteT m) Source # | |
Monad m => Monad (QuoteT m) Source # | |
Monad m => MonadQuote (QuoteT m) Source # | |
class Monad m => MonadQuote m Source #
A monad that allows lifting of quoted expressions.
Instances
MonadQuote m => MonadQuote (GenT m) Source # | |
Defined in PlutusCore.Quote | |
MonadQuote m => MonadQuote (PropertyT m) Source # | |
Defined in PlutusCore.Quote | |
Monad m => MonadQuote (QuoteT m) Source # | |
MonadQuote m => MonadQuote (MaybeT m) Source # | |
MonadQuote m => MonadQuote (RenameT ren m) Source # | |
MonadQuote m => MonadQuote (ExceptT e m) Source # | |
MonadQuote m => MonadQuote (ReaderT r m) Source # | |
MonadQuote m => MonadQuote (StateT s m) Source # | |
(Stream s, MonadQuote m) => MonadQuote (ParsecT e s m) Source # | |
Defined in PlutusCore.Parser.ParserCommon | |
MonadQuote m => MonadQuote (NormalizeTypeT m tyname uni ann) Source # | |
Defined in PlutusCore.Normalize.Internal liftQuote :: Quote a -> NormalizeTypeT m tyname uni ann a Source # |
type FreshState = Unique Source #
The state contains the "next" Unique
that should be used for a name
liftQuote :: MonadQuote m => Quote a -> m a Source #
markNonFreshBelow :: MonadQuote m => Unique -> m () Source #
markNonFresh :: MonadQuote m => Unique -> m () Source #
markNonFreshMax :: MonadQuote m => Set Unique -> m () Source #