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

PlutusIR.Compiler.Definitions

Description

Support for generating PIR with global definitions with dependencies between them.

Synopsis

Documentation

data DefT key uni fun ann m a Source #

Instances

Instances details
(Ord key, Monad m) => MonadDefs key uni fun ann (DefT key uni fun ann m) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

liftDef :: DefT key uni fun ann Identity a -> DefT key uni fun ann m a Source #

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

Defined in PlutusIR.Compiler.Definitions

Methods

ask :: DefT key uni fun ann m r Source #

local :: (r -> r) -> DefT key uni fun ann m a -> DefT key uni fun ann m a Source #

reader :: (r -> a) -> DefT key uni fun ann m a Source #

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

Defined in PlutusIR.Compiler.Definitions

Methods

get :: DefT key uni fun ann m s Source #

put :: s -> DefT key uni fun ann m () Source #

state :: (s -> (a, s)) -> DefT key uni fun ann m a Source #

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

Defined in PlutusIR.Compiler.Definitions

Methods

throwError :: e -> DefT key uni fun ann m a Source #

catchError :: DefT key uni fun ann m a -> (e -> DefT key uni fun ann m a) -> DefT key uni fun ann m a Source #

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

Defined in PlutusIR.Compiler.Definitions

Methods

writer :: (a, w) -> DefT key uni fun ann m a Source #

tell :: w -> DefT key uni fun ann m () Source #

listen :: DefT key uni fun ann m a -> DefT key uni fun ann m (a, w) Source #

pass :: DefT key uni fun ann m (a, w -> w) -> DefT key uni fun ann m a Source #

MFunctor (DefT key uni fun ann :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> DefT key uni fun ann m b -> DefT key uni fun ann n b Source #

MonadTrans (DefT key uni fun ann) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

lift :: Monad m => m a -> DefT key uni fun ann m a Source #

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

Defined in PlutusIR.Compiler.Definitions

Methods

(>>=) :: DefT key uni fun ann m a -> (a -> DefT key uni fun ann m b) -> DefT key uni fun ann m b Source #

(>>) :: DefT key uni fun ann m a -> DefT key uni fun ann m b -> DefT key uni fun ann m b Source #

return :: a -> DefT key uni fun ann m a Source #

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

Defined in PlutusIR.Compiler.Definitions

Methods

fmap :: (a -> b) -> DefT key uni fun ann m a -> DefT key uni fun ann m b Source #

(<$) :: a -> DefT key uni fun ann m b -> DefT key uni fun ann m a Source #

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

Defined in PlutusIR.Compiler.Definitions

Methods

pure :: a -> DefT key uni fun ann m a Source #

(<*>) :: DefT key uni fun ann m (a -> b) -> DefT key uni fun ann m a -> DefT key uni fun ann m b Source #

liftA2 :: (a -> b -> c) -> DefT key uni fun ann m a -> DefT key uni fun ann m b -> DefT key uni fun ann m c Source #

(*>) :: DefT key uni fun ann m a -> DefT key uni fun ann m b -> DefT key uni fun ann m b Source #

(<*) :: DefT key uni fun ann m a -> DefT key uni fun ann m b -> DefT key uni fun ann m 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 #

class (Monad m, Ord key) => MonadDefs key uni fun ann m | m -> key uni fun ann where Source #

Minimal complete definition

Nothing

Methods

liftDef :: DefT key uni fun ann Identity a -> m a Source #

default liftDef :: (MonadDefs key uni fun ann n, MonadTrans t, t n ~ m) => DefT key uni fun ann Identity a -> m a Source #

Instances

Instances details
MonadDefs key uni fun ann m => MonadDefs key uni fun ann (ReaderT r m) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

liftDef :: DefT key uni fun ann Identity a -> ReaderT r m a Source #

MonadDefs key uni fun ann m => MonadDefs key uni fun ann (ExceptT e m) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

liftDef :: DefT key uni fun ann Identity a -> ExceptT e m a Source #

MonadDefs key uni fun ann m => MonadDefs key uni fun ann (StateT s m) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

liftDef :: DefT key uni fun ann Identity a -> StateT s m a Source #

(Ord key, Monad m) => MonadDefs key uni fun ann (DefT key uni fun ann m) Source # 
Instance details

Defined in PlutusIR.Compiler.Definitions

Methods

liftDef :: DefT key uni fun ann Identity a -> DefT key uni fun ann m a Source #

type TermDefWithStrictness uni fun ann = Def (VarDecl TyName Name uni fun ann) (Term TyName Name uni fun ann, Strictness) Source #

runDefT :: (Monad m, Ord key) => ann -> DefT key uni fun ann m (Term TyName Name uni fun ann) -> m (Term TyName Name uni fun ann) Source #

defineTerm :: MonadDefs key uni fun ann m => key -> TermDefWithStrictness uni fun ann -> Set key -> m () Source #

modifyTermDef :: MonadDefs key uni fun ann m => key -> (TermDefWithStrictness uni fun ann -> TermDefWithStrictness uni fun ann) -> m () Source #

defineType :: MonadDefs key uni fun ann m => key -> TypeDef TyName uni ann -> Set key -> m () Source #

modifyTypeDef :: MonadDefs key uni fun ann m => key -> (TypeDef TyName uni ann -> TypeDef TyName uni ann) -> m () Source #

defineDatatype :: forall key uni fun ann m. MonadDefs key uni fun ann m => key -> DatatypeDef TyName Name uni fun ann -> Set key -> m () Source #

modifyDatatypeDef :: MonadDefs key uni fun ann m => key -> (DatatypeDef TyName Name uni fun ann -> DatatypeDef TyName Name uni fun ann) -> m () Source #

modifyDeps :: MonadDefs key uni fun ann m => key -> (Set key -> Set key) -> m () Source #

Modifies the dependency set of a key.

recordAlias :: forall key uni fun ann m. MonadDefs key uni fun ann m => key -> m () Source #

lookupTerm :: MonadDefs key uni fun ann m => ann -> key -> m (Maybe (Term TyName Name uni fun ann)) Source #

lookupOrDefineTerm :: MonadDefs key uni fun ann m => ann -> key -> m (TermDefWithStrictness uni fun ann, Set key) -> m (Term TyName Name uni fun ann) Source #

lookupType :: MonadDefs key uni fun ann m => ann -> key -> m (Maybe (Type TyName uni ann)) Source #

lookupOrDefineType :: MonadDefs key uni fun ann m => ann -> key -> m (TypeDef TyName uni ann, Set key) -> m (Type TyName uni ann) Source #

lookupConstructors :: MonadDefs key uni fun ann m => ann -> key -> m (Maybe [Term TyName Name uni fun ann]) Source #

lookupDestructor :: forall key uni fun ann m. MonadDefs key uni fun ann m => ann -> key -> m (Maybe (Term TyName Name uni fun ann)) Source #