plutus-core-1.0.0.1: Language library for Plutus Core
Safe Haskell None
Language Haskell2010

PlutusCore.Subst

Synopsis

Documentation

substTyVarA :: Applicative 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.

substVarA :: Applicative 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.

termSubstNamesM :: Monad 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).

termSubstTyNamesM :: Monad 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).

typeSubstTyNamesM :: Monad 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).

termSubstFreeNamesA :: ( Applicative f, HasUnique name TermUnique ) => (name -> f ( Maybe ( Term tyname name uni fun ann))) -> Term tyname name uni fun ann -> f ( Term tyname name uni fun ann) Source #

Applicatively substitute *free* names using the given function.

termSubstFreeNames :: HasUnique name TermUnique => (name -> Maybe ( Term tyname name uni fun ann)) -> Term tyname name uni fun ann -> Term tyname name uni fun ann Source #

Substitute *free* names using the given function.

fvTerm :: Ord name => Term tyname name uni fun ann -> Set name Source #

Get all the free term variables in a term.

ftvTerm :: Ord tyname => Term tyname name uni fun ann -> Set tyname Source #

Get all the free type variables in a term.

ftvTy :: Ord tyname => Type tyname uni ann -> Set tyname Source #

Get all the free type variables in a type.

vTerm :: Ord name => Term tyname name uni fun ann -> Set name Source #

Get all the term variables in a term.

tvTerm :: Ord tyname => Term tyname name uni fun ann -> Set tyname Source #

Get all the type variables in a term.

tvTy :: Ord tyname => Type tyname uni ann -> Set tyname Source #

Get all the type variables in a type.

uniquesType :: HasUniques ( Type tyname uni ann) => Type tyname uni ann -> Set Unique Source #

Get all the uniques in a type.

uniquesTerm :: HasUniques ( Term tyname name uni fun ann) => Term tyname name uni fun ann -> Set Unique Source #

Get all the uniques in a term (including the type-level ones).