Class methods don't have unfoldings defined, relying instead of BuiltInRules for inlining. BuiltInRules are functions, so we can't reify them and use them in HERMIT. However, we have access to all the same information that is used to build the BuiltInRule in the mg_inst_env, so we should be able to build an inlining from that and use it in inlineR.
Motivated by #157
Given the strategy outlined in:
https://github.com/ghc/ghc/blob/2db18b8135335da2da9918b722699df684097be9/compiler/typecheck/TcInstDcls.hs#L158
Class methods don't have unfoldings defined, relying instead of BuiltInRules for inlining. BuiltInRules are functions, so we can't reify them and use them in HERMIT. However, we have access to all the same information that is used to build the BuiltInRule in the mg_inst_env, so we should be able to build an inlining from that and use it in inlineR.
For the code which builds the rule, see:
https://github.com/ghc/ghc/blob/f3cc34568b13abb29de7b54a5f657681e9e116ca/compiler/basicTypes/MkId.hs#L307