IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.57k stars 479 forks source link

Refactor: reduce code duplication and make more uniform how plugin looks up GHC things (Names, Ids, etc.) #6672

Closed Unisay closed 1 week ago

Unisay commented 1 week ago

Some chores before adding new functionality:

Extracted 3 utility lookup functions:

  1. lookupGhcId :: Compiling uni fun m ann => TH.Name -> m GHC.Id
  2. lookupGhcName :: Compiling uni fun m ann => TH.Name -> m GHC.Name
  3. lookupGhcTyCon :: Compiling uni fun m ann => TH.Name -> m GHC.TyCon

and used them uniformly where appropriate. This allowed to reduce some code duplication in compileExpr