| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusIR.Compiler.Provenance
Description
Module handling provenances of terms.
Synopsis
- data Provenance a
- = Original a
- | LetBinding Recursivity (Provenance a)
- | TermBinding String (Provenance a)
- | TypeBinding String (Provenance a)
- | DatatypeComponent DatatypeComponent (Provenance a)
- | MultipleSources (Set (Provenance a))
- noProvenance :: Provenance a
- data DatatypeComponent
- data GeneratedKind = RecursiveLet
- setProvenance :: Functor f => Provenance b -> f a -> f (Provenance b)
- original :: Functor f => f a -> f (Provenance a)
Documentation
data Provenance a #
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 Doc ann # |
setProvenance :: Functor f => Provenance b -> f a -> f (Provenance b) #
Set the provenance on a term to the given value.
original :: Functor f => f a -> f (Provenance a) #
Mark all the annotations on a term as original. Useful for preparing terms for the PIR compiler.