plutus-tx-plugin- The Plutus Tx compiler and GHC plugin
Safe HaskellSafe-Inferred



Functions for compiling GHC names into Plutus Core names.



lookupNameScope uni → Name → Maybe (PLCVar uni) Source #

getUntidiedOccString ∷ Name → String Source #

Reverses the OccName tidying that GHC does, see tidyOccEnv and accompanying Notes.

This is bad, because it makes it much harder to read since the disambiguating numbers are gone. However, these appear to be non-deterministic (possibly depending on the order in which modules are processed?), so we can't rely on them.

Essentially, we just strip off trailing digits. This might remove "real" digits added by the user, but there's not much we can do about that.

Note that this only affects the *textual* name, not the underlying unique, so it has no effect on the behaviour of the program, merely on how it is printed.

compileNameFreshMonadQuote m ⇒ Name → m Name Source #

compileVarFreshCompilingDefault uni fun m ann ⇒ Ann → Var → m (PLCVar uni) Source #

compileVarWithTyFreshCompilingDefault uni fun m ann ⇒ Ann → Var → PIRType uni → m (PLCVar uni) Source #

Like compileVarFresh, but takes a PIRType instead of obtaining the PIR type from the given Expr.

lookupTyNameScope uni → Name → Maybe PLCTyVar Source #

compileTyVarFreshCompiling uni fun m ann ⇒ TyVar → m PLCTyVar Source #

compileTcTyVarFreshCompiling uni fun m ann ⇒ TyCon → m PLCTyVar Source #

pushName ∷ Name → PLCVar uni → Scope uni → Scope uni Source #

pushNames ∷ [(Name, PLCVar uni)] → Scope uni → Scope uni Source #

pushTyName ∷ Name → PLCTyVarScope uni → Scope uni Source #

pushTyNames ∷ [(Name, PLCTyVar)] → Scope uni → Scope uni Source #