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

PlutusIR.Transform.Substitute

Description

Implements naive substitution functions for replacing type and term variables.

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