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

UntypedPlutusCore.Transform.Inline

Description

An inlining pass.

This pass is essentially a copy of the PIR inliner, and should be KEPT IN SYNC with it. It's hard to do this with true abstraction, so we just have to keep two copies reasonably similar.

However, there are some differences. In the interests of making it easier to keep things in sync, these are explicitly listed in Note [Differences from PIR inliner]. If you add another difference, please note it there! Obviously fewer differences is better.

See Note [The problem of inlining destructors] for why this pass exists.

Synopsis

Documentation

inline Source #

Arguments

∷ ∀ name uni fun m a. ExternalConstraints name uni fun m 
Size

inline threshold

Bool

inline constants

Bool

preserve logging

InlineHints name a 
BuiltinSemanticsVariant fun 
Term name uni fun a 
SimplifierT name uni fun a m (Term name uni fun a) 

Inline simple bindings. Relies on global uniqueness, and preserves it. See Note [Inlining and global uniqueness]

newtype InlineHints name a Source #

Constructors

InlineHints 

Fields

Instances

Instances details
Show (InlineHints name a) Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

showsPrecIntInlineHints name a → ShowS Source #

showInlineHints name a → String Source #

showList ∷ [InlineHints name a] → ShowS Source #

Default (InlineHints name a) Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

defInlineHints name a Source #

Exported for testing

type InlineM name uni fun a = ReaderT (InlineInfo name fun a) (StateT (S name uni fun a) Quote) Source #

The monad the inliner runs in.

data S name uni fun a Source #

UPLC inliner state

Constructors

S 

Fields

Instances

Instances details
Monoid (S name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

Methods

memptyS name uni fun a Source #

mappendS name uni fun a → S name uni fun a → S name uni fun a Source #

mconcat ∷ [S name uni fun a] → S name uni fun a Source #

Semigroup (S name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

Methods

(<>)S name uni fun a → S name uni fun a → S name uni fun a Source #

sconcatNonEmpty (S name uni fun a) → S name uni fun a Source #

stimesIntegral b ⇒ b → S name uni fun a → S name uni fun a Source #

newtype Subst name uni fun a Source #

Wrapper of term substitution so that it's similar to the PIR inliner. See Note [Differences from PIR inliner] 1

Constructors

Subst 

Fields

Instances

Instances details
Monoid (Subst name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

Methods

memptySubst name uni fun a Source #

mappendSubst name uni fun a → Subst name uni fun a → Subst name uni fun a Source #

mconcat ∷ [Subst name uni fun a] → Subst name uni fun a Source #

Semigroup (Subst name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

Methods

(<>)Subst name uni fun a → Subst name uni fun a → Subst name uni fun a Source #

sconcatNonEmpty (Subst name uni fun a) → Subst name uni fun a Source #

stimesIntegral b ⇒ b → Subst name uni fun a → Subst name uni fun a Source #

Generic (Subst name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

Associated Types

type Rep (Subst name uni fun a) ∷ TypeType Source #

Methods

fromSubst name uni fun a → Rep (Subst name uni fun a) x Source #

toRep (Subst name uni fun a) x → Subst name uni fun a Source #

type Rep (Subst name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

type Rep (Subst name uni fun a) = D1 ('MetaData "Subst" "UntypedPlutusCore.Transform.Inline" "plutus-core-1.48.0.0-inplace" 'True) (C1 ('MetaCons "Subst" 'PrefixI 'True) (S1 ('MetaSel ('Just "_termEnv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TermEnv name uni fun a))))

newtype TermEnv name uni fun a Source #

Term substitution, Subst in the paper. A map of unprocessed variable and its substitution range.

Constructors

TermEnv 

Fields

Instances

Instances details
Monoid (TermEnv name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

Methods

memptyTermEnv name uni fun a Source #

mappendTermEnv name uni fun a → TermEnv name uni fun a → TermEnv name uni fun a Source #

mconcat ∷ [TermEnv name uni fun a] → TermEnv name uni fun a Source #

Semigroup (TermEnv name uni fun a) Source # 
Instance details

Defined in UntypedPlutusCore.Transform.Inline

Methods

(<>)TermEnv name uni fun a → TermEnv name uni fun a → TermEnv name uni fun a Source #

sconcatNonEmpty (TermEnv name uni fun a) → TermEnv name uni fun a Source #

stimesIntegral b ⇒ b → TermEnv name uni fun a → TermEnv name uni fun a Source #

isFirstVarBeforeEffects ∷ ∀ name uni fun ann. InliningConstraints name uni fun ⇒ BuiltinSemanticsVariant fun → name → Term name uni fun ann → Bool Source #

isStrictIn ∷ ∀ name uni fun a. Eq name ⇒ name → Term name uni fun a → Bool Source #

Check if the given name is strict in the given term. This means that at least one occurrence of the name is found outside of the following: * delay term * lambda body * case branch

effectSafe Source #

Arguments

∷ ∀ name uni fun a. InliningConstraints name uni fun 
Term name uni fun a 
→ name 
Bool

is it pure? See Note [Inlining and purity]

InlineM name uni fun a Bool