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

PlutusIR.Compiler.Provenance

Description

Module handling provenances of terms.

Synopsis

Documentation

data Provenance a Source #

Indicates where a value comes from.

This is either an original annotation or a pieces of context explaining how the term relates to a previous Provenance. We also provide noProvenance for convenience.

The provenance should always be just the original annotation, if we have one. It should only be another kind of provenance if we're in the process of generating some term that doesn't correspond directly to a term in the original AST.

Constructors

Original a 
LetBinding Recursivity (Provenance a) 
TermBinding String (Provenance a) 
TypeBinding String (Provenance a) 
DatatypeComponent DatatypeComponent (Provenance a) 
MultipleSources (Set (Provenance a))

Added for accumulating difference provenances when floating lets

Instances

Instances details
Foldable Provenance Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Methods

foldMonoid m ⇒ Provenance m → m Source #

foldMapMonoid m ⇒ (a → m) → Provenance a → m Source #

foldMap'Monoid m ⇒ (a → m) → Provenance a → m Source #

foldr ∷ (a → b → b) → b → Provenance a → b Source #

foldr' ∷ (a → b → b) → b → Provenance a → b Source #

foldl ∷ (b → a → b) → b → Provenance a → b Source #

foldl' ∷ (b → a → b) → b → Provenance a → b Source #

foldr1 ∷ (a → a → a) → Provenance a → a Source #

foldl1 ∷ (a → a → a) → Provenance a → a Source #

toListProvenance a → [a] Source #

nullProvenance a → Bool Source #

lengthProvenance a → Int Source #

elemEq a ⇒ a → Provenance a → Bool Source #

maximumOrd a ⇒ Provenance a → a Source #

minimumOrd a ⇒ Provenance a → a Source #

sumNum a ⇒ Provenance a → a Source #

productNum a ⇒ Provenance a → a Source #

Ord a ⇒ Monoid (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Ord a ⇒ Semigroup (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Generic (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Associated Types

type Rep (Provenance a) ∷ TypeType Source #

Methods

fromProvenance a → Rep (Provenance a) x Source #

toRep (Provenance a) x → Provenance a Source #

Show a ⇒ Show (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Eq a ⇒ Eq (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Methods

(==)Provenance a → Provenance a → Bool Source #

(/=)Provenance a → Provenance a → Bool Source #

Ord a ⇒ Ord (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Hashable a ⇒ Hashable (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Methods

hashWithSaltIntProvenance a → Int Source #

hashProvenance a → Int Source #

Pretty a ⇒ Pretty (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Methods

prettyProvenance a → Doc ann Source #

prettyList ∷ [Provenance a] → Doc ann Source #

type Rep (Provenance a) Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

type Rep (Provenance a) = D1 ('MetaData "Provenance" "PlutusIR.Compiler.Provenance" "plutus-core-1.38.0.0-inplace-plutus-ir" 'False) ((C1 ('MetaCons "Original" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "LetBinding" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Recursivity) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Provenance a))) :+: C1 ('MetaCons "TermBinding" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Provenance a))))) :+: (C1 ('MetaCons "TypeBinding" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Provenance a))) :+: (C1 ('MetaCons "DatatypeComponent" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DatatypeComponent) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Provenance a))) :+: C1 ('MetaCons "MultipleSources" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set (Provenance a)))))))

data DatatypeComponent Source #

Instances

Instances details
Generic DatatypeComponent Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Associated Types

type Rep DatatypeComponentTypeType Source #

Show DatatypeComponent Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Eq DatatypeComponent Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Ord DatatypeComponent Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Hashable DatatypeComponent Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

Pretty DatatypeComponent Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

type Rep DatatypeComponent Source # 
Instance details

Defined in PlutusIR.Compiler.Provenance

type Rep DatatypeComponent = D1 ('MetaData "DatatypeComponent" "PlutusIR.Compiler.Provenance" "plutus-core-1.38.0.0-inplace-plutus-ir" 'False) ((C1 ('MetaCons "Constructor" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "ConstructorType" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "Destructor" 'PrefixI 'False) (U1TypeType))) :+: (C1 ('MetaCons "DestructorType" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "DatatypeType" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "PatternFunctor" 'PrefixI 'False) (U1TypeType))))

setProvenanceFunctor f ⇒ Provenance b → f a → f (Provenance b) Source #

Set the provenance on a term to the given value.

originalFunctor f ⇒ f a → f (Provenance a) Source #

Mark all the annotations on a term as original. Useful for preparing terms for the PIR compiler.