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

PlutusCore.Generators.QuickCheck.Substitutions

Synopsis

Documentation

substTypeCustomGo Source #

Arguments

∷ HasCallStack 
⇒ Bool

Nested (True) or parallel (False)

→ Set TyName

Variables that are considered free.

→ TypeSub

Type substitution to use.

→ Type TyName DefaultUni ()

Type to substitute in.

→ Type TyName DefaultUni () 

The most general substitution worker.

substTypeCustom Source #

Arguments

∷ HasCallStack 
⇒ Bool

Nested (True) or parallel (False)

→ TypeSub 
→ Type TyName DefaultUni () 
→ Type TyName DefaultUni () 

Generalized substitution algorithm.

substType ∷ HasCallStack ⇒ TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni () Source #

Regular (i.e. nested type substitution).

substTypeParallel ∷ TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni () Source #

Parallel substitution.

renameVar ∷ TyName → TyName → Type TyName DefaultUni () → Type TyName DefaultUni () Source #

Rename one variable to another.

fvTypeR ∷ TypeSub → Type TyName DefaultUni () → Set TyName Source #

Find all free type variables of type a given substitution sub. If variable x is free in a but in the domain of sub we look up x in sub and get all the free type variables of the result - up to the substitution.

Generators for substitutions

fvTypeBag ∷ Type TyName DefaultUni () → Map TyName Int Source #

Get the free type variables in a type along with how many times they occur. The elements of the map are guaranteed to be non-zero.

genSubst ∷ TypeCtx → Gen TypeSub Source #

Generate a type substitution mapping some of the variables in the given context to some arbitrary types (valid in the context).