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

PlutusCore.Quote

Synopsis

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.

freshName :: MonadQuote m => Text -> m Name Source #

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

freshTyName :: MonadQuote m => Text -> m TyName Source #

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

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.

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

lift :: Monad m => m a -> QuoteT m a Source #

MonadReader r m => MonadReader r (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

ask :: QuoteT m r Source #

local :: (r -> r) -> QuoteT m a -> QuoteT m a Source #

reader :: (r -> a) -> QuoteT m a Source #

MonadState s m => MonadState s (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

get :: QuoteT m s Source #

put :: s -> QuoteT m () Source #

state :: (s -> (a, s)) -> QuoteT m a Source #

MonadError e m => MonadError e (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

throwError :: e -> QuoteT m a Source #

catchError :: QuoteT m a -> (e -> QuoteT m a) -> QuoteT m a Source #

MonadWriter w m => MonadWriter w (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

writer :: (a, w) -> QuoteT m a Source #

tell :: w -> QuoteT m () Source #

listen :: QuoteT m a -> QuoteT m (a, w) Source #

pass :: QuoteT m (a, w -> w) -> 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 #

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 => 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 #

MonadIO m => MonadIO (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftIO :: IO a -> QuoteT m a Source #

Monad m => MonadQuote (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> QuoteT m a Source #

MFunctor QuoteT Source # 
Instance details

Defined in PlutusCore.Quote

Methods

hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> QuoteT m b -> QuoteT n b 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 (MaybeT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> MaybeT m a Source #

MonadQuote m => MonadQuote (PropertyT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> PropertyT m a Source #

MonadQuote m => MonadQuote (GenT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> GenT m a Source #

Monad m => MonadQuote (QuoteT m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> QuoteT m a Source #

MonadQuote m => MonadQuote (ReaderT r m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> ReaderT r m a Source #

MonadQuote m => MonadQuote (StateT s m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> StateT s m a Source #

MonadQuote m => MonadQuote (ExceptT e m) Source # 
Instance details

Defined in PlutusCore.Quote

Methods

liftQuote :: Quote a -> ExceptT e m a Source #

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

Defined in PlutusCore.Rename.Monad

Methods

liftQuote :: Quote a -> RenameT ren m a Source #

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

Defined in PlutusCore.ParserCommon

Methods

liftQuote :: Quote a -> ParsecT e s m a Source #

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

Defined in PlutusCore.Normalize.Internal

Methods

liftQuote :: Quote a -> NormalizeTypeT m tyname uni ann a Source #

MonadQuote m => MonadQuote (DefT key uni fun ann m) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

liftQuote :: Quote a -> DefT key uni fun ann m 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 #

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

markNonFresh :: MonadQuote 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.

markNonFreshMax :: MonadQuote 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.