plutus-core-1.30.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Quote

Synopsis

Documentation

runQuoteTMonad 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.

runQuoteQuote a → a Source #

freshUniqueMonadQuote m ⇒ m Unique Source #

Get a fresh Unique.

freshNameMonadQuote m ⇒ Text → m Name Source #

Get a fresh Name, given the annotation and the Text name.

freshTyNameMonadQuote m ⇒ Text → m TyName Source #

Get a fresh TyName, given the annotation and the Text name.

freshenNameMonadQuote m ⇒ Name → m Name Source #

Make a copy of the given Name that is distinct from the old one.

freshenTyNameMonadQuote m ⇒ TyName → m TyName Source #

Make a copy of the given TyName that is distinct from the old one.

newtype QuoteT m a Source #

The "quotation" monad transformer. Within this monad you can do safe construction of PLC terms using quasiquotation, fresh-name generation, and parsing.

Constructors

QuoteT 

Fields

Instances

Instances details
MonadTrans QuoteT Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftMonad m ⇒ m a → QuoteT m a

MFunctor QuoteT Source # 
Instance details

Defined in PlutusCore.Quote

Methods

hoist ∷ ∀ m n (b ∷ k). Monad m ⇒ (∀ a. m a → n a) → QuoteT m b → QuoteT n b

MonadError e m ⇒ MonadError e (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

throwError ∷ e → QuoteT m a

catchErrorQuoteT m a → (e → QuoteT m a) → QuoteT m a

MonadReader r m ⇒ MonadReader r (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

askQuoteT m r

local ∷ (r → r) → QuoteT m a → QuoteT m a

reader ∷ (r → a) → QuoteT m a

MonadState s m ⇒ MonadState s (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

getQuoteT m s

put ∷ s → QuoteT m ()

state ∷ (s → (a, s)) → QuoteT m a

MonadWriter w m ⇒ MonadWriter w (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

writer ∷ (a, w) → QuoteT m a

tell ∷ w → QuoteT m ()

listenQuoteT m a → QuoteT m (a, w)

passQuoteT m (a, w → w) → QuoteT m a

MonadFix m ⇒ MonadFix (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

mfix ∷ (a → QuoteT m a) → QuoteT m a Source #

MonadIO m ⇒ MonadIO (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftIOIO a → QuoteT m a Source #

Monad m ⇒ Applicative (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

pure ∷ a → QuoteT m a Source #

(<*>)QuoteT m (a → b) → QuoteT m a → QuoteT m b Source #

liftA2 ∷ (a → b → c) → QuoteT m a → QuoteT m b → QuoteT m c Source #

(*>)QuoteT m a → QuoteT m b → QuoteT m b Source #

(<*)QuoteT m a → QuoteT m b → QuoteT m a Source #

Functor m ⇒ Functor (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

fmap ∷ (a → b) → QuoteT m a → QuoteT m b Source #

(<$) ∷ a → QuoteT m b → QuoteT m a Source #

Monad m ⇒ Monad (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

(>>=)QuoteT m a → (a → QuoteT m b) → QuoteT m b Source #

(>>)QuoteT m a → QuoteT m b → QuoteT m b Source #

return ∷ a → QuoteT m a Source #

Monad m ⇒ MonadQuote (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → QuoteT m a Source #

type Quote = QuoteT Identity Source #

A non-transformer version of QuoteT.

class Monad m ⇒ MonadQuote m Source #

A monad that allows lifting of quoted expressions.

Instances

Instances details
MonadQuote m ⇒ MonadQuote (GenT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → GenT m a Source #

MonadQuote m ⇒ MonadQuote (PropertyT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → PropertyT m a Source #

Monad m ⇒ MonadQuote (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → QuoteT m a Source #

MonadQuote m ⇒ MonadQuote (MaybeT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → MaybeT m a Source #

MonadQuote m ⇒ MonadQuote (RenameT ren m) Source # 
Instance details

Defined in PlutusCore.Rename.Monad

Methods

liftQuoteQuote a → RenameT ren m a Source #

MonadQuote m ⇒ MonadQuote (ExceptT e m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → ExceptT e m a Source #

MonadQuote m ⇒ MonadQuote (ReaderT r m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → ReaderT r m a Source #

MonadQuote m ⇒ MonadQuote (StateT s m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuoteQuote a → StateT s m a Source #

(Stream s, MonadQuote m) ⇒ MonadQuote (ParsecT e s m) Source # 
Instance details

Defined in PlutusCore.Parser.ParserCommon

Methods

liftQuoteQuote a → ParsecT e s m a Source #

MonadQuote m ⇒ MonadQuote (NormalizeTypeT m tyname uni ann) Source # 
Instance details

Defined in PlutusCore.Normalize.Internal

Methods

liftQuoteQuote 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

liftQuoteMonadQuote m ⇒ Quote a → m a Source #

markNonFreshBelowMonadQuote m ⇒ Unique → m () Source #

Mark all Uniques less than the given Unique as used, so they will not be generated in future.

markNonFreshMonadQuote m ⇒ Unique → m () Source #

Mark a given Unique (and implicitly all Uniques less than it) as used, so they will not be generated in future.

markNonFreshMaxMonadQuote m ⇒ Set Unique → m () Source #

Mark the maximal Unique from a set of Uniques (and implicitly all Uniques less than it) as used, so they will not be generated in future.