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

PlutusCore.Analysis.Definitions

Description

Definition analysis for Plutus Core.

Synopsis

Documentation

type UniqueInfos ann = UniqueMap Unique (UniqueInfo ann) Source #

data ScopeType Source #

Tag for distinguishing between whether we are talking about the term scope for variables or the type scope for variables.

Constructors

TermScope 
TypeScope 

termDefs ∷ (Ord ann, HasUnique name TermUnique, HasUnique tyname TypeUnique, MonadState (UniqueInfos ann) m, MonadWriter [UniqueError ann] m) ⇒ Term tyname name uni fun ann → m () Source #

Given a PLC term, add all of its term and type definitions and usages, including its subterms and subtypes, to a global map.

handleType ∷ (Ord ann, HasUnique tyname TypeUnique, MonadState (UniqueInfos ann) m, MonadWriter [UniqueError ann] m) ⇒ Type tyname uni ann → m () Source #

Given a type, add its type definition/usage, including its subtypes, to a global map.

runTermDefs ∷ (Ord ann, HasUnique name TermUnique, HasUnique tyname TypeUnique, Monad m) ⇒ Term tyname name uni fun ann → m (UniqueInfos ann, [UniqueError ann]) Source #

addDef Source #

Arguments

∷ (Ord ann, HasUnique n unique, MonadState (UniqueInfos ann) m, MonadWriter [UniqueError ann] m) 
⇒ n

The variable

→ ann

The annotation of the variable

ScopeType

The scope type

→ m () 

addUsage Source #

Arguments

∷ (Ord ann, HasUnique n unique, MonadState (UniqueInfos ann) m, MonadWriter [UniqueError ann] m) 
⇒ n

The variable

→ ann

The annotation of the variable

ScopeType

The scope type

→ m ()