GHC does not specialize based on type equality
Based on my testing, it seems that if I have a function like
f :: (v ~ V2) => v -> v
this will be slower than
f :: V2 -> V2
It would be great if GHC could do this optimization. The reason I want this is that I have written some very generic functions in my program, which are actually only used for one type. SPECIALIZE doesn't seem to do enough, as it's hard to get those GHC to "see" all of those types. As a compromise, I tried to tell GHC what those types actually are via type equalities, so that I can keep type constraints around for the future.