Refactor functions related to coercion optimisation?
There are quite a few functions that (to the best of my knowledge) are used only for coercion optimisation. In particular I think this holds for the following in GHC.Core.Coercion
:
setNominalRole_maybe
splitAppCo_maybe
promoteCoercion
instCoercion
instCoercions
There's also liftCoMatch
and the functions it calls in GHC.Core.Unify
.
Would it make sense to factor these out into a separate module that is imported only from GHC.Core.Coercion.Opt
? That would seem better from a modularity perspective and make it clear they aren't intended for "general" use.