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

PlutusIR.Transform.Substitute

Description

Implements naive substitution functions for replacing type and term variables.

Synopsis

Documentation

substVar :: (name -> Maybe (Term tyname name uni fun a)) -> Term tyname name uni fun a -> Maybe (Term tyname name uni fun a) Source #

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.

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

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

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

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