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

PlutusCore.Subst

Synopsis

Documentation

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.

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.

substTyVar ∷ (tyname → Maybe (Type tyname uni ann)) → Type tyname uni ann → Type tyname uni ann Source #

Replace a type variable using the given function.

substVar ∷ (name → Maybe (Term tyname name uni fun ann)) → Term tyname name uni fun ann → Term tyname name uni fun ann Source #

Replace a variable using the given function.

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

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

typeSubstTyNamesMMonad m ⇒ (tyname → m (Maybe (Type tyname uni ann))) → Type tyname uni ann → m (Type tyname uni ann) Source #

Naively monadically substitute type names (i.e. do not substitute binders). INLINE is important here because the function is too polymorphic (determined from profiling)

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

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

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

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

typeSubstTyNames ∷ (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).

typeSubstClosedTypeEq tyname ⇒ tyname → Type tyname uni a → Type tyname uni a → Type tyname uni a Source #

Substitute the given closed Kind for the given type variable in the given Kind. Does not descend under binders that bind the same variable as the one we're substituting for (since from there that variable is no longer free). The resulting Term may and likely will not satisfy global uniqueness.

termSubstClosedTypeEq tyname ⇒ tyname → Type tyname uni a → Term tyname name uni fun a → Term tyname name uni fun a Source #

Substitute the given closed Kind for the given type variable in the given Term. Does not descend under binders that bind the same variable as the one we're substituting for (since from there that variable is no longer free). The resulting Term may and likely will not satisfy global uniqueness.

termSubstClosedTermEq name ⇒ name → Term tyname name uni fun a → Term tyname name uni fun a → Term tyname name uni fun a Source #

Substitute the given closed Term for the given term variable in the given Term. Does not descend under binders that bind the same variable as the one we're substituting for (since from there that variable is no longer free). The resulting Term may and likely will not satisfy global uniqueness.

typeMapNames ∷ ∀ tyname tyname' uni ann. (tyname → tyname') → Type tyname uni ann → Type tyname' uni ann Source #

termMapNames ∷ ∀ tyname tyname' name name' uni fun ann. (tyname → tyname') → (name → name') → Term tyname name uni fun ann → Term tyname' name' uni fun ann Source #

programMapNames ∷ ∀ tyname tyname' name name' uni fun ann. (tyname → tyname') → (name → name') → Program tyname name uni fun ann → Program tyname' name' uni fun ann Source #

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

Get all the free term variables in a term.

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

Get all the free type variables in a term.

ftvTyHasUnique tyname unique ⇒ Traversal' (Type tyname uni ann) tyname Source #

Get all the free type variables in a type.

ftvTyCtxHasUnique tyname unique ⇒ UniqueSet unique → Traversal' (Type tyname uni ann) tyname Source #

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 ∷ Fold (Type tyname uni ann) tyname Source #

Get all the type variables in a type.

purely ∷ ((a → Identity b) → c → Identity d) → (a → b) → c → d Source #