Refactor mapType/mapCoercion so that they inline
mapType
and mapCoercion
are very convenient functions for writing transformations over types and coercions. But they current don't inline properly, meaning that the TyCoMapper
that describes their behavior is not inlined, and thus preventing other optimizations.
Instead, they should be refactored to be like https://gitlab.haskell.org/ghc/ghc/blob/wip/T17509/compiler/types/TyCoRep.hs#L1742, where we have carefully ensured that similar functions inline.
Main work done in #!2683 (closed).
Remaining task: use mapType
more!