Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Functions for compiling GHC names into Plutus Core names.
Synopsis
- lookupName ∷ Scope uni → Name → Maybe (PLCVar uni)
- getUntidiedOccString ∷ Name → String
- compileNameFresh ∷ MonadQuote m ⇒ Name → m Name
- compileVarFresh ∷ CompilingDefault uni fun m ann ⇒ Ann → Var → m (PLCVar uni)
- compileVarWithTyFresh ∷ CompilingDefault uni fun m ann ⇒ Ann → Var → PIRType uni → m (PLCVar uni)
- lookupTyName ∷ Scope uni → Name → Maybe PLCTyVar
- compileTyNameFresh ∷ MonadQuote m ⇒ Name → m TyName
- compileTyVarFresh ∷ Compiling uni fun m ann ⇒ TyVar → m PLCTyVar
- compileTcTyVarFresh ∷ Compiling uni fun m ann ⇒ TyCon → m PLCTyVar
- pushName ∷ Name → PLCVar uni → Scope uni → Scope uni
- pushNames ∷ [(Name, PLCVar uni)] → Scope uni → Scope uni
- pushTyName ∷ Name → PLCTyVar → Scope uni → Scope uni
- pushTyNames ∷ [(Name, PLCTyVar)] → Scope uni → Scope uni
Documentation
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.
compileNameFresh ∷ MonadQuote m ⇒ Name → m Name Source #
compileVarFresh ∷ CompilingDefault uni fun m ann ⇒ Ann → Var → m (PLCVar uni) Source #
compileVarWithTyFresh ∷ CompilingDefault 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
.
compileTyNameFresh ∷ MonadQuote m ⇒ Name → m TyName Source #