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

PlutusIR.Subst

Synopsis

Documentation

substVarAApplicative f ⇒ (name → f (Maybe (Term tyname name uni fun ann))) → Term tyname name uni fun ann → f (Term tyname name uni fun ann) Source #

Applicatively replace a variable using the given function.

substTyVarAApplicative f ⇒ (tyname → f (Maybe (Type tyname uni ann))) → Type tyname uni ann → f (Type tyname uni ann) Source #

Applicatively replace a type variable using the given function.

typeSubstTyNames ∷ ∀ tyname (uni ∷ TypeType) ann. (tyname → Maybe (Type tyname uni ann)) → Type tyname uni ann → Type tyname uni ann Source #

Naively substitute type names (i.e. do not substitute binders).

termSubstNames ∷ (name → Maybe (Term tyname name uni fun a)) → Term tyname name uni fun a → Term tyname name uni fun a Source #

Naively substitute names using the given functions (i.e. do not substitute binders).

termSubstNamesMMonad m ⇒ (name → m (Maybe (Term tyname name uni fun ann))) → Term tyname name uni fun ann → m (Term tyname name uni fun ann) Source #

Naively monadically substitute names using the given function (i.e. do not substitute binders).

termSubstTyNames ∷ (tyname → Maybe (Type tyname uni a)) → Term tyname name uni fun a → Term tyname name uni fun a Source #

Naively substitute type names using the given functions (i.e. do not substitute binders).

termSubstTyNamesMMonad m ⇒ (tyname → m (Maybe (Type tyname uni ann))) → Term tyname name uni fun ann → m (Term tyname name uni fun ann) Source #

Naively monadically substitute type names using the given function (i.e. do not substitute binders).

bindingSubstNames ∷ (name → Maybe (Term tyname name uni fun a)) → Binding tyname name uni fun a → Binding tyname name uni fun a Source #

Naively substitute names using the given functions (i.e. do not substitute binders).

bindingSubstTyNames ∷ (tyname → Maybe (Type tyname uni a)) → Binding tyname name uni fun a → Binding tyname name uni fun a Source #

Naively substitute type names using the given functions (i.e. do not substitute binders).

fvTermHasUnique name TermUnique ⇒ Traversal' (Term tyname name uni fun ann) name Source #

Get all the free term variables in a PIR term.

ftvTermHasUnique tyname TypeUnique ⇒ Traversal' (Term tyname name uni fun ann) tyname Source #

Get all the free type variables in a PIR term.

fvBindingHasUnique name TermUnique ⇒ Traversal' (Binding tyname name uni fun ann) name Source #

Get all the free variables in a PIR single let-binding.

ftvBindingHasUnique tyname TypeUniqueRecursivity → Traversal' (Binding tyname name uni fun ann) tyname Source #

Get all the free type variables in a PIR single let-binding.

ftvTy ∷ ∀ tyname unique (uni ∷ TypeType) ann. HasUnique tyname unique ⇒ Traversal' (Type tyname uni ann) tyname Source #

Get all the free type variables in a type.

vTerm ∷ Fold (Term tyname name uni fun ann) name Source #

Get all the term variables in a term.

tvTerm ∷ Fold (Term tyname name uni fun ann) tyname Source #

Get all the type variables in a term.

tvTy ∷ ∀ tyname (uni ∷ TypeType) ann f. (Contravariant f, Applicative f) ⇒ (tyname → f tyname) → Type tyname uni ann → f (Type tyname uni ann) Source #

Get all the type variables in a type.

substConstantAApplicative f ⇒ (ann → Some (ValueOf uni) → f (Maybe (Term tyname name uni fun ann))) → Term tyname name uni fun ann → f (Term tyname name uni fun ann) Source #

Applicatively replace a constant using the given function.

substConstant ∷ (ann → Some (ValueOf uni) → Maybe (Term tyname name uni fun ann)) → Term tyname name uni fun ann → Term tyname name uni fun ann Source #

Replace a constant using the given function.

termSubstConstantsMMonad m ⇒ (ann → Some (ValueOf uni) → m (Maybe (Term tyname name uni fun ann))) → Term tyname name uni fun ann → m (Term tyname name uni fun ann) Source #

Monadically substitute constants using the given function.

termSubstConstants ∷ (ann → Some (ValueOf uni) → Maybe (Term tyname name uni fun ann)) → Term tyname name uni fun ann → Term tyname name uni fun ann Source #

Substitute constants using the given function.