Previously, derived implementations of to/from in Generic
instances were wastefully putting extra M1s in every case, which led
to an O(n) increase in the number of coercions, resulting in a slowdown
during the typechecker phase.
This factors out the common M1 in every case of a to/from
definition so that the typechecker has far fewer coercions to deal with.
For a datatype with 300 constructors, this change has been observed to
save almost 3 seconds of compilation time.
This is one step towards coming up with a solution for Trac #5642.